SQL Server 2012 is putting [brackets] around Table and Column Names
There isn't a way to prevent this. Microsoft feels that it is better to prevent you from shooting yourself in the foot, probably since the number of people out there who create databases, objects or columns with bad names (e.g. my table
or date
) or reserved keywords (e.g. log
or timestamp
) outnumber those who never do so.
There was a Connect item asking for this option, and it was very quickly dismissed and closed as "Won't Fix." And in fact many more users were asking that square brackets be added to places where they previously didn't work.
If you are running SSMS 2017 at least v17.6, there is now an option to turn this off. In the options dialog, go to "SQL Server Object Explorer" and then to "Commands". Under the "Drag/Drop" heading is a new option "Surround object names with brackets when dragged". By default, this is set to True, so just change it to False. SSMS may need to be restarted to make the change effective.
Note: Any objects that need the brackets (eg. with spaces or other whitespace/non-alphanumeric characters, reserved keywords) will still have brackets when drag/dropped.
SSMS 17.6 added the ability to turn that off.
Here's how to do it:
Tools > Options > SQL Server Object Explorer > Commands, under the Drag/Drop section set "Surround object names with brackets when dragged" to False.
According to Microsoft, Names that include spaces or closing brackets will always be escaped.