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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 set input parameter to zero if null or blank

Author  Topic 

gagani
Posting Yak Master

112 Posts

Posted - 2015-01-08 : 17:09:26
I am passing few parameters to the sql function to do some calculations. If the input parameter is null or blank, then I want to set the input parameter to the value zero

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-01-08 : 17:20:27
IF @var1 IS NULL OR @var1 = ''
SET @var1 = 0

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -