Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to check if string variable is null?

$
0
0

Hello guys!
-----------------------------------------------------
I have an SQL Server StoredProcedure which has an output parameter @ProcOutput of the type VARCHAR.
The output value can be:
 - an empty string;
 - not an empty string;
 - the NULL;
After the StoredProcedure has been executed, I have to analize the value of the output parameter in a Precedence Constraint.
-----------------------------------------------------
To do this, I created a package variable named PackVar of type STRING.
Then I mapped the StoredProcedure output parameter to the package variable PackVar.
But when the StoredProcedure returns NULL, my Precedence Constraint does not work - the PackVar equals an empty string.
This is inappropriate to me as NULL and Empty String are to be treated differently in the package.
My Precedence Constraint is written the next way:
 - Value:      Success
 - Expression: ISNULL(@PackVar)
-----------------------------------------------------
Could you please advise me how to resolve the issue?

Thanks in advance,
BorkaS


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>