Groups | Blog | Home
all groups > sql server dts > september 2006 >

sql server dts : SQL task result set with Nulls -- how to assign to variable?



artzoop NO[at]SPAM hotmail.com
9/14/2006 8:22:27 AM
Hi,
I have an SQL task that returns 3 columns from a select statement (eg,
Select a, b, c from tableabc). I assign my result set result names 0,
1, 2 to three User global variables (which happen to be type string).
All works fine as long as a, b, c contain values on the tableabc. If
any column is NULL, however, the SQL task assigns strange characters to
the assigned variable.

I have a script task following the SQL task that tries to determine if
any of the a, b, c variables are NULL, but because they get assigned
with strange characters, they never are.

Is there some workaround for this -- ie, how to avoid the strange
characters getting assigned to my variables?

Thank you,

Greg
Simon Sabin
9/14/2006 10:10:03 PM
Hello Greg,

This is easy to reproduce and was recently noted as a being in the process
of being fixed.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=101249&SiteID=1

I guess the work around is to have protective coding against NULLS

Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons


[quoted text, click to view]

AddThis Social Bookmark Button