x

disable square braces when generating scripts from SSMS

How do I disable square braces when generating scripts from SSMS?

more ▼

asked Oct 12, 2009 at 10:27 AM in Default

binoj gravatar image

binoj
32 1 1 1

(comments are locked)
10|1200 characters needed characters left

7 answers: sort oldest

While it might bother you, it's a good practice. It ensures that any strange characters in your objects, spaces, etc., don't cause issues when you run the script. You might think you'll never do this, but with a version upgrade, that table you created in a previous version might not have a keyword for a name.

more ▼

answered Oct 12, 2009 at 10:53 AM

Steve Jones - Editor gravatar image

Steve Jones - Editor ♦♦
5.1k 78 79 82

Agreed. Probably best just to leave them in. However, Darren provided the way to remove them all if you really want them removed.
Jun 01, 2010 at 03:33 PM TimothyAWiseman
(comments are locked)
10|1200 characters needed characters left

You can't, as far as I know.

more ▼

answered Oct 12, 2009 at 10:49 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.5k 61 65 87

(comments are locked)
10|1200 characters needed characters left

Currently there is no option to do this. It is SQL Servers fail-safe way of generating scripts for YOUR objects, that you might have named with a reserved keyword.

more ▼

answered Oct 12, 2009 at 10:51 AM

Kev Riley gravatar image

Kev Riley ♦♦
54.3k 47 49 76

(comments are locked)
10|1200 characters needed characters left

I think it is a nuisance, and I agree wholehartedly with the questioner that there ought to be a way to kick it out. Although I have to admit that I occasionally use them when I accidentally use a reserved word, I don't see why one should not be able to enforce a 'standards' mode in a database, and do without the square braces. To illustrate the way that one can abuse all guidelines for sensible programming by means of square braces, see my blog post. Evil Code

more ▼

answered Oct 12, 2009 at 11:04 AM

Phil Factor gravatar image

Phil Factor
3.9k 8 9 16

Have to say I agree with you sir. I especially like the way that you can include square brackets in a name by double quoting - vb style. For example, a column called [[[]]] would appear in SQL text as [[[]]]]]. Neat. (!)
Oct 12, 2009 at 11:55 AM Matt Whitfield ♦♦
Prefer not to use them either, so annoying. Have a look at the following feature request, I added a comment to broaden its context a little: https://connect.microsoft.com/SQLServer/feedback/details/540306/ssms-improvements-required-for-dragging-columns-from-object-explorer
May 15, 2013 at 11:36 AM Valentino Vranken
(comments are locked)
10|1200 characters needed characters left

Hate It. I believe there should be something like the VB "Option Explicit" which would explicitly disable any reserved words from being a DB object.

more ▼

answered Oct 12, 2009 at 12:54 PM

dvroman gravatar image

dvroman
1.1k 2 2

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x348
x129
x69
x15
x1

asked: Oct 12, 2009 at 10:27 AM

Seen: 5223 times

Last Updated: May 15, 2013 at 11:36 AM