Tuesday, March 20, 2012

Check for NULL in stored procedure

How can i check if the value of the variable is NULL in the stored procedure

My variable data type is bigint and i did like

If varName =NULL

print 'Hello'

Else

....

But this is not working it never print "Hello" and later says that you are trying to insert NULL value .

Ashish

Something like this:

Code Snippet

declare @.varName varchar(20)

if @.varname is null

print 'Hello'

sql

No comments:

Post a Comment