select * from dbo.MyTable
where ID = 101
Error message:
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ' '.
The case:
I wrote this simple query and copy-paste the ID number from e-mail/some chat or something like this.
Cause:
Pay atention - there is a space in the end of the query.
So? it's still not suppose to be a problem....
BUT - this is not realy a space, but "Non-breaking space".
Check it, by select the ascii code of this "Non-breaking space" (copy it from the end of the query and of a regular space:
select ASCII(' '), ASCII(' ')
Solution:
Very simple, as you already can guess - remove this ' '.
No comments:
Post a Comment