Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
davidR
Starting Member
5 Posts |
Posted - 2008-04-24 : 19:48:56
|
| In SQL Sever 2005, I am trying to retrieve data using this simple query from a table called 'User':select *from dbo.Userwhere UserID='sam'And, I keep getting the following error:Msg 156, Level 15, State 1, Line 2Incorrect syntax near the keyword 'User'.Thank you for your help |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-24 : 19:54:38
|
| User is a reserved word, so you have to surround the name with square brackets.select *from dbo.[User]where UserID='sam'Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|