December 23, 2008 at 11:14 am
Blinking RED.
OUCH !
Merry Christmas.
December 23, 2008 at 1:04 pm
I heard name is a reserved MDX word (http://msdn.microsoft.com/en-us/library/ms145629.aspx), and "Type" is used in permission statements (GRANT) - http://msdn.microsoft.com/en-us/library/ms174346.aspx
December 23, 2008 at 1:10 pm
TYPE is also used in some FOR XML statements.
UID was ubiquitous in most of the system views in 2000 (sysobjects, sysusers, permisssions, etc....), is a keyword in ado connection strings (like what you might set up in OPENROWSET), and is an implicit rowID in xml data sets (although I don't think in 2005). So - common enough to possibly "pre-reserve".
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
December 23, 2008 at 1:19 pm
Steve Jones - Editor (12/23/2008)
Which is my earlier point. It is nice that they highlight ALL of the keywords that they have ever used in the entire product offering but since the colorization is not filtered by context, you get a ton of "false positives" depending upon what you are typing.
So if I'm entering a standard SQL query, I shouldn't be bothered by reserved words in MDX. Which BTW, is not part of any SQL standard.
Numerous tools (e.g., TOAD, Embacadero, etc.) and text editors also have syntax colorization, including keywords. Some of these applications allow you to modify the keyword/reserved word list.
Therefore, use the colorization as a quide tempered by the context of what you are typing.
December 23, 2008 at 2:06 pm
By the way - here's an example of TYPE being used as a T-SQL keyword:
select * from MyTable
where MyID=1234
for XML path('testing'), TYPE
Not sure why that didn't make the reserved list.
Considering you can mix DCL and DML and MDX in scripts, why wouldn't you want them highlighted as possible sticking points? It would be nice if the colorizer were a tad bit smarter, but I do see why it's done the way it is.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
December 23, 2008 at 2:26 pm
Matt Miller (12/23/2008)
By the way - here's an example of TYPE being used as a T-SQL keyword:
select * from MyTable
where MyID=1234
for XML path('testing'), TYPE
Not sure why that didn't make the reserved list.
Considering you can mix DCL and DML and MDX in scripts, why wouldn't you want them highlighted as possible sticking points? It would be nice if the colorizer were a tad bit smarter, but I do see why it's done the way it is.
Yes, and I understand what is happening. BTW, I've written queries that return XML.
So the following query shows the [keyword] "type" being returned as a column name as well as the use of "type" in proper syntax. Both are highlighted but only one is really a "keyword".
[font="Courier New"]SELECT
u.user_id AS UserID,
u.type AS Type
FROM users u
FOR XML PATH('testing'), TYPE[/font]
So the take-away is to not panic and feel that you have to change your code, query, whatever when you see terms highlighted as "keywords" within the SSMS editor.
P.S. I actually use an external editor to write all of my SQL Server code (table DDL, sprocs, UDFs, etc.) and only use SSMS to validate it and/or perform unit tests. The editor has syntax colorization with a unionized set of keywords that cover both Oracle and SQL Server with the colorization only being used as a "guide". Since we have all of our code as separate files within our source code control system, and the editor is invoked directly from the source code control menu, I'm not really monitoring the keyword colorization of SSMS.
December 23, 2008 at 2:37 pm
JohnG (12/23/2008)
So the take-away is to not panic and feel that you have to change your code, query, whatever when you see terms highlighted as "keywords" within the SSMS editor.
Agreed. It earns a second glance but not much more.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply