SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Use of brackets around data names


Use of brackets around data names

Author
Message
Howard C. BAchtel-438731
Howard C. BAchtel-438731
SSC-Addicted
SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)

Group: General Forum Members
Points: 482 Visits: 391
We recently upgraded to SQL Server 2012 and the Query Analyzer defaults to putting all data names inside brackets. Is there a way to change a "setting" so the brackets are not added by default?

Thanks in advance
Lowell
Lowell
SSC Guru
SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)

Group: General Forum Members
Points: 70952 Visits: 40924
Howard I have 2012, but I'm not sure where, specifically, you are talking about where the objects get bracketed by the quotename() function;

do you mean when you script an object? I did not see a scripting option for that feature when i peeked there.

i don't see intellisense doing anything like that, so i'm not sure where you are seeing this behavior?

Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (213K reputation)SSC Guru (213K reputation)SSC Guru (213K reputation)SSC Guru (213K reputation)SSC Guru (213K reputation)SSC Guru (213K reputation)SSC Guru (213K reputation)SSC Guru (213K reputation)

Group: General Forum Members
Points: 213007 Visits: 41977
Howard C. BAchtel-438731 (6/4/2013)
We recently upgraded to SQL Server 2012 and the Query Analyzer defaults to putting all data names inside brackets. Is there a way to change a "setting" so the brackets are not added by default?

Thanks in advance


If this is occurring when you generate scrips, it's been that way since I can remember (6.5 in my case).

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Howard C. BAchtel-438731
Howard C. BAchtel-438731
SSC-Addicted
SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)SSC-Addicted (482 reputation)

Group: General Forum Members
Points: 482 Visits: 391
Sorry,
I should have been more specific in description. The question relates to building queries in SQLMS. A brief sample of a query would be:
Select
[DateInactive],
[Inactive]

The brackets around the fields I believe are meant to be able to handle data names with spaces. I prefer to not have any names without spaces and the brackets are inconvenient at best for my uses. I would like to adjust a "setting" that would not produce the brackets when dragging the data name from the table definition.

Thanks.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)

Group: General Forum Members
Points: 51053 Visits: 21154
I don't like it either, but can't see any way of turning it off.

I know it's a bit OTT, but I've actually written a program to automate certain 'tweaks' to T-SQL code in line with my own coding preferences - and the removal of redundant [] characters is one of those tweaks, as I got tired/bored of continually doing find/replace.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search