all groups > sql server dts > october 2006 >
You're in the

sql server dts

group:

ActiveX Converting Zero Length Strings to Nulls


ActiveX Converting Zero Length Strings to Nulls rmcompute
10/26/2006 4:33:01 PM
sql server dts:
In order to test the data from the source file, I changed the DTS load job to
use an ActiveX script instead of just a copy. I noticed that data with a
zero length string are getting converted to nulls and this is causing an
issue. There is nothing in the command which tells it to do a conversion:

DTSDestination("Segment") = DTSSource("Segment")

Can a default control be set to prevent this from happening or do I have to
change each line of code to something like:

If DTSSource("Segment") = '' Then
''
Else
DTSDestination("Segment") = DTSSource("Segment")
End If

Re: ActiveX Converting Zero Length Strings to Nulls Jay
10/27/2006 12:37:41 PM
I've encountered that issue as well. I'm pretty sure you have to code
(as you did below) to handle the zero length strings.

One thing to keep the amount of code down you could use:

DTSDestination("Segment") = IIF(DTSSource("Segment") = "",
"",DTSSource("Segment") )

Not always the easiet code to read, but it reduces the lines of code
written.


Jay

[quoted text, click to view]
Re: ActiveX Converting Zero Length Strings to Nulls rmcompute
10/28/2006 9:52:02 AM
Glad to hear I am not the only one experiencing this. One thing, I tried the
code listed below and got this error:

VBScript runtime error Type mismatch: IIF.

The IF End If statement works with this particular field. Are you sure the
IIF statement is valid in this context ?

Thanks.

[quoted text, click to view]
AddThis Social Bookmark Button