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 |
snow12
Yak Posting Veteran
74 Posts |
Posted - 2012-06-28 : 16:00:01
|
Hello:I have a column have NULL value. When I use:select * from student where name IS NULLI got syntax error Msg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'IS'.Where I missed? Thank you for your help |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2012-06-28 : 16:59:38
|
There is nothing wrong with the syntax that you posted. If this is still an issue please post the entire batch of code that you are having a problem with.Be One with the OptimizerTG |
|
|
snow12
Yak Posting Veteran
74 Posts |
Posted - 2012-06-28 : 17:05:38
|
Hello:Thanks for the reply.I use: select * from dbo.studentThe result:student updateaa NULLac NULL I use: select * from dbo.student where update is nullMsg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'is'. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2012-06-28 : 17:11:18
|
Ugh - "Update" is a sql key word. put a bracket around "update" - and then don't use sql key words for object names select * from dbo.student where [update] is nullBe One with the OptimizerTG |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
|
snow12
Yak Posting Veteran
74 Posts |
Posted - 2012-06-29 : 17:38:38
|
Thank you very much! |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2012-06-29 : 20:47:04
|
you're welcome.Be One with the OptimizerTG |
|
|
|
|
|