Hi,
I created a database with couple of tables and some table names are enclosed with square bracket: [table_name]
Does anyone qnow why this happen, and how to get rid of it?
Thanks!
Hi,
I created a database with couple of tables and some table names are enclosed with square bracket: [table_name]
Does anyone qnow why this happen, and how to get rid of it?
Thanks!
Are the tables in question MSSQL keywords? It's a common notation to put MSSQL object names in brackets. It's no big deal.
The square brackets are to indicate that the name represents an object and not a reserved word. By default SQL Server adds these to make sure the scripts it generates run correctly.
When you use SQL Server Management Studio to script out your objects it will enclose all names with square brackets.
They are only necessary when the name contains a space or a reserved word (such as [Name])
.
Putting square brackets Sql Server allows you to use reserved words or phrases with spaces as identifiers. If your table containes any of these, it's normal behaviour.