May 13, 2003 at 12:15 pm
Why are you selecting the name, and then setting equal to null? Do you mean to check whether the value is null? If so, try:
declare @s varchar(10)
select @s=name from table
if @s IS NULL begin
--do operation
end
May 13, 2003 at 12:38 pm
You should always use column IS NULL rather than column = NULL. Nulls do not equal each other (or itself).
Patrick
Quand on parle du loup, on en voit la queue
May 13, 2003 at 3:31 pm
I covered this in the following article http://www.sqlservercentral.com/columnists/jtravis/understandingthedifferencebetweenisnull.asp
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply