dbTalk Databases Forums  

ActiveX: Set destination = NULL instead of 0?

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


Discuss ActiveX: Set destination = NULL instead of 0? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default ActiveX: Set destination = NULL instead of 0? - 07-19-2006 , 08:03 AM






Hello. I am importing a CSV file (from Excel) into a SQL 2000 table.
There is a column called Children which signifies "number of children."
This is a tinyint in the SQL table so I wrote an ActiveX transform to
convert from the CSV string value (see below). It works fine except
when there is no value for Children in the CSV, a zero is placed in the
SQL column. I would like the SQL value to be NULL in those cases, but
I can't get it to work that way. Any suggestions?

I have tried:
Else
DTSDestination("Children") = Null

but it didn't work, still came up with 0.

'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

Function Main()
If Not IsNull(DTSSource("Children")) Then
DTSDestination("Children") = Cint(DTSSource("Children"))
End If
Main = DTSTransformStat_OK
End Function


Thanks
David


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.