2

When SSMS creates a query for a table, all object names have [] around them.

They are useful in some rare situations, but names I use for my objects never need them. Then I always need to use replace to remove one and then the other.

Is there a way to do it automatically, be it a macro executed by a shortcut or config SSMS to not create them?

Hikari
  • 3,797
  • 12
  • 47
  • 77
  • It won't hurt you now and it may be useful in the future. I would just leave them. – Evan Mulawski Jul 13 '15 at 17:25
  • 3
    For the most part I just use ctrl+ H to do a find and replace. Then just replace the [ with nothing. – Zane Jul 13 '15 at 17:30
  • 2
    Take a look at http://dba.stackexchange.com/questions/21779/sql-server-2012-is-putting-brackets-around-table-and-column-names as @EvanMulawski said, its better having the brackets in case one day you'll code, say, table named 'my table' – Shmil The Cat Jul 13 '15 at 17:31
  • There's no reason NOT to use them. Why not leave them and save yourself all the time and energy? – pmbAustin Jul 13 '15 at 17:47
  • As I said, the names I use never need them. I'll never create a `[my table]` or a `[preço]`. I wanna remove them because they are clumsy and affect readability. – Hikari Jul 14 '15 at 16:17

0 Answers0