Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Use of brackets around data names Expand / Collapse
Author
Message
Posted Tuesday, June 4, 2013 11:48 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 6:58 AM
Points: 94, Visits: 380
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
Post #1459888
Posted Tuesday, June 4, 2013 1:27 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:31 AM
Points: 12,962, Visits: 32,501
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1459919
Posted Tuesday, June 4, 2013 4:41 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 2:11 PM
Points: 35,772, Visits: 32,441
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1459984
Posted Tuesday, June 4, 2013 6:31 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 6:58 AM
Points: 94, Visits: 380
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.
Post #1460000
Posted Wednesday, June 5, 2013 4:29 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 2:15 AM
Points: 5,317, Visits: 12,354
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1460137
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse