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 |