I am a beginner in Sql server, I am doubtful about the following code:
declare @var nvarchar(50) = null
declare @bool bit
if (@var = null)
set @bool = 1
else
set @bool = 0
print @bool
The variable @bool
returns as 0
, even though I declare the variable @var
to be null.
Would not it be to return as 1
?