I’ve noticed that Visual Studio 2008 is placing square brackets around column names in SQL. Do the brackets offer any advantage? When I hand code T-SQL I’ve never bothered with them.
Example:
Visual Studio:
SELECT [column1], [column2] etc...
My own way:
SELECT column1, column2 etc...
The brackets are required if you use keywords or special chars in the column names or identifiers. You could name a column
[First Name](with a space) – but then you’d need to use brackets every time you referred to that column.The newer tools add them everywhere just in case or for consistency.