[Read Between the Brackets]
I’ve been working in SQL Server Management Studio 2012 today and found something rather annoying. I tried to execute an SQL Command DROP PROCEDURE someProcedure and received an error warning stating that my syntax was incorrect somewhere at ‘ ‘.
I have two observations:
- What a useless error message
The problem was that SSMS expected DROP PROCEDURE [someProcedure]. - The requirement of brackets is a new “Feature” of SQL Server 2012. I’m using SSMS against a 2008 database, and the syntax is valid. So, SSMS is wrong based on the syntax of SQL Server 2008.
There may be a configuration setting in SSMS to set the version you’re working against…I’ll see if I can find more.
Sadly, Microsoft feels it is important to enclose all you object/column names in []. I have never used them for nearly 30 years. Why must I use them now? I don’t use reserved words for table/column/etc. names. I don’t put spaces in my object names. Brackets or quoted identifiers are not necessary if you follow those two principles. But Microsoft knows better, and forces changes on things that require no change.
This means that I have thousands of scripts that will not work because they don’t enclose object and column names in []. I guess I have to brush up on my regex.
Are you having fun with SQL Server 2012? Drop me a note with your experiences at btaylor@sswug.org.
Cheers,
Ben
$$SWYNK$$
Featured Article(s)
Import or Export Files to or from in MSSQL 2005 and above versions.
For the SQL 7.0 and SQL 2000 versions, the textCopy.exe utility was helpful in doing the Task of importing or exporting files to an image (or text) table column in the MSSQL Server. The textCopy.exe utility became obsolete in the late versions of the MSSQL product and is no longer supported on newer versions of MSSQL.New TSQL methods for importing and exporting data are presented here and can be implemented instead.
Featured White Paper(s)
Top 10 Tips for Optimizing SQL Server Performance
read more)
Featured Script
monitor DB blocking
This script checks for blocking spids and writes them, along with the task they executed, into a maintenance..head_blockers t… (read more)