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

avatar image

binoj
32 1 2 3

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

7 answers: sort voted first

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 now have a keyword for a name.

more ▼

answered Oct 12, 2009 at 10:53 AM

avatar image

Steve Jones - Editor ♦♦
5.1k 79 93 87

(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

avatar image

Phil Factor
4.2k 8 22 20

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

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

avatar image

Kev Riley ♦♦
63.8k 48 61 81

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

RegEx Find and Replace. Find "[[]]" Replace ""

more ▼

answered Jun 01, 2010 at 09:52 AM

avatar image

Darren 1
11

That's a bit of a sub-standard approach, as it would blanket remove all square braces, even where they are required for non-natural identifiers.

Jun 01, 2010 at 10:24 AM Matt Whitfield ♦♦

@Matt, I agree with you, but if the original poster want to disable them then the poster presumably knows that they are not necessary. This is the closest thing to a direct solution to the original question I saw.

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

avatar image

Matt Whitfield ♦♦
29.5k 62 66 88

(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:

x408
x152
x85
x20

asked: Oct 12, 2009 at 10:27 AM

Seen: 10150 times

Last Updated: Aug 01, 2015 at 01:14 AM

Copyright 2016 Redgate Software. Privacy Policy