|
How do I disable square braces when generating scripts from SSMS?
(comments are locked)
|
|
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. 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 '10 at 03:33 PM
TimothyAWiseman
(comments are locked)
|
|
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 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 '09 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 at 11:36 AM
Valentino Vranken
(comments are locked)
|
|
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.
(comments are locked)
|
|
RegEx Find and Replace. Find "[\[\]]" Replace "" 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 '10 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 '10 at 03:33 PM
TimothyAWiseman
(comments are locked)
|
|
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.
(comments are locked)
|
1 2 next page »

