March 15, 2004 at 5:29 pm
Real quick, easy question:
Is "description" a SQL reserved word, or to be avoided for any reason?
Thanks,
SMK
March 15, 2004 at 8:49 pm
smknox,
I use a lot of words that show up as keyword, but I'm careful to use "[" and "]" around each word. Some words I use that come up as keywords:
Name
Description
Database
User
As long as you're careful there's not problem using them. Especially "Name" and "Description"; I use those all over the place.
cl
Signature is NULL
March 16, 2004 at 7:37 am
Description is NOT a keyword.
For a list of keywords, refer to the BOL, use the Index tab, enter "Keywords, reserved for SQL Server".
-SQLBill
BOL=Books OnLine=MS SQL Server Help
Installed as part of the CLIENT TOOLS
Found at Start>Programs>Microsoft SQL Server>Books OnLine
March 16, 2004 at 12:13 pm
SQLBill,
Why does Description show up blue in QA? It's kinda misleading.
Signature is NULL
March 17, 2004 at 6:17 am
We converted from another DBMS to SQL Server and it used quite a few words that show up in blue (supposedly reserved).
Description is one of them, another is version. Neither have caused us any problems at all. I don't think any DBMS should have a problem with a column name of "description" though - it's so commonly used, both in new and legacy - especially legacy - systems.
We do, however, stay away from names that are blatantly reserved, and are slowly but surely, converting some of the others to other column names.
Cheers,
Joe
-- Joe
March 17, 2004 at 9:58 am
That is interesting. I'll keep looking and see what I can find out about it. It might be KEYWORDs but if so they aren't listed that way.
-SQLBill
March 17, 2004 at 10:37 am
Description, is a word known to SQL Server, hence the coloring of the word to blue which is the clue that the program is treating it as an embedded term and not the noun that you have in mind.
To stabilize your results, enclose the name in square brackets [description]
March 17, 2004 at 11:15 am
Thanks for the comments. How about just avoiding the term as a column name? Isn't that preferable just to prevent future issues?
SMK
March 17, 2004 at 12:15 pm
Yeah, words that throw syntax errors should usually not be object or column names. Still, I do it sometimes anyway (a table named Database, for example). Description and Name are columns I use on a large percentage of tables, but they don't throw syntax errors (even though their highlighted).
cl
Signature is NULL
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply