Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So, apparently you can't name a table Trigger in SQLServer. Someone in my office found out the hard way porting an application from MySQL, I'm suspicious of whether or not that's a valid table name in MySQL either.

Is there a list of invalid table (or object) names in SQLServer? Is it just all the keywords? I'd imagine SELECT select FROM select.select isn't valid. Is there ever a case where merely adding an underscore to the end of a keyword would still produce an invalid table (or object) name in SQLServer?

Question is in reference to SQLServer 2000 and up, but mainly 2005 and 2008

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I believe you can use SQL server reserved words as object names as long as you wrap them in square brackets:
Select [select] from [select]

However, I would NOT recommend this, and stay away from naming any SQL server objects after reserved names (or words that might be reserved in the future).

There was a list of these words in the SQL server documentation, they are on MSDN.

share|improve this answer
    
Thanks that helps a lot, now I need to take a big long grep –  Peter Turner Oct 24 '12 at 18:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.