Possible Duplicate:
How to deal with SQL column names that look like SQL keywords?
SELECT thing.Column FROM mytable thing
When I run this, SQL Server says that I have "Incorrect syntax near the keyword 'Column'
Possible Duplicate:
How to deal with SQL column names that look like SQL keywords?
SELECT thing.Column FROM mytable thing
When I run this, SQL Server says that I have "Incorrect syntax near the keyword 'Column'
You can enclose the column name in square brackets, thusly:
SELECT thing.[Column] FROM mytable thing
You can also use double-quotes (I believe this is the more standard SQL syntax):
SELECT thing."Column" FROM mytable thing
Note that double-quotes only work when QUOTED_IDENTIFIER is on, however it is on by default.
Here is the MSDN reference on delimited identifiers.
Like this:
SELECT [thing].[Column] FROM [mytable] AS [thing]
Keep trying to use those brackets every time, cause You never know when Your system will migrate to a newer version and if the new one hasn't got new set of reserved words.