The brackets are necessary if you use special characters (spaces, periods, ...) in the names of the elements of the database (database, tables, columns, views, ...).
For example you can create a field in a table with the name mi campo
. If you make a query of the type:
SELECT mi campo FROM tabla
SQL Server will try to find the field mi
in table tabla
and use the alias campo
for the result. If there is no field mi
will return an error.
It is in these cases when brackets must be used:
SELECT [mi campo] FROM tabla
Many query generation tools are always added to avoid problems, but would only be necessary in those cases.