dbTalk Databases Forums  

SQL task result set with Nulls -- how to assign to variable?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SQL task result set with Nulls -- how to assign to variable? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
artzoop@hotmail.com
 
Posts: n/a

Default SQL task result set with Nulls -- how to assign to variable? - 09-14-2006 , 10:22 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


Reply With Quote
  #2  
Old   
Simon Sabin
 
Posts: n/a

Default Re: SQL task result set with Nulls -- how to assign to variable? - 09-14-2006 , 05:10 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/Sho...01249&SiteID=1

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

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


Quote:
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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.