SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 using sql keywords
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mike123
Flowing Fount of Yak Knowledge

1462 Posts

Posted - 04/25/2008 :  12:24:14  Show Profile  Reply with Quote

When designing a table, or column name. I am sure its best to avoid using table names or column names that use reserved words such as

"status" and "message"

What happens when we name a column or table using these words? Any tiny performance hit ? I am just wondering whats happening behind the scenes.


Thanks!
mike123

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 04/25/2008 :  13:59:12  Show Profile  Visit spirit1's Homepage  Reply with Quote
none. since you have to quote them anyway -> [status]


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

mike123
Flowing Fount of Yak Knowledge

1462 Posts

Posted - 04/25/2008 :  16:02:26  Show Profile  Reply with Quote
quote:
Originally posted by spirit1

none. since you have to quote them anyway -> [status]




I've found that in some of my old designs and sprocs, I didnt quote them and it worked .. just wondering if its something that I could redesign ? I'll add quotes in the meantime :)
thx!
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6059 Posts

Posted - 04/25/2008 :  18:21:25  Show Profile  Reply with Quote
depending on the specific key word it may work without the brackets. If you have a column named [SELECT] you will always have to bracket that one :)

Be One with the Optimizer
TG
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36638 Posts

Posted - 04/25/2008 :  18:37:55  Show Profile  Visit tkizer's Homepage  Reply with Quote
I believe you always have to use square brackets when you use a reserved word for a table name but not always the case with column names.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

jezemine
Flowing Fount of Yak Knowledge

USA
2885 Posts

Posted - 04/26/2008 :  02:35:33  Show Profile  Visit jezemine's Homepage  Reply with Quote
just because a word changes color in the query editor doesn't mean it's a reserved word.

status and message are both examples of such words. neither requires the square brackets. go ahead and use those two for object or column names if you like.

http://msdn2.microsoft.com/en-us/library/ms189822.aspx


elsasoft.org
Go to Top of Page

jezemine
Flowing Fount of Yak Knowledge

USA
2885 Posts

Posted - 04/26/2008 :  02:42:00  Show Profile  Visit jezemine's Homepage  Reply with Quote
I work a lot with road and map data - in that field you come across the most ridiculous stuff. One of tables we get from the map data vendor has a column named TABLE. that's very confusing. Haven't run across any tables named COLUMN yet though...


elsasoft.org
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6059 Posts

Posted - 04/26/2008 :  09:28:12  Show Profile  Reply with Quote
Some idiot at one of my previous jobs (me) named a table [group]. We all had to live with that brainstorm for awhile :(

Be One with the Optimizer
TG
Go to Top of Page

m_k_s@hotmail.com
Insecure what ??

38 Posts

Posted - 04/27/2008 :  14:33:24  Show Profile  Visit m_k_s@hotmail.com's Homepage  Reply with Quote
This isn't really a big deal. Brackets around keywords resolves most issues. If you continue to have issues, I'd try prefixing in addition to bracketing.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000