Simple DTS to SSIS conversion? -
06-14-2010
, 05:20 PM
I have a DTS package with Transformations that look like this:
Function Main()
DTSDestination("PART_PAY_PAYMENT") = DTSSource("Col030")
DTSDestination("PART_PAY_TOTAL_DUE") = DTSSource("Col031")
DTSDestination("PART_PAY_CUMUL_DUE") = DTSSource("Col032")
'DTSDestination("PART_PAY_REMAINDER_DUE") = DTSSource("Col033")
if len(trim(DTSSource("Col033"))) > 0 then
DTSDestination("PART_PAY_REMAINDER_DUE") = DTSSource("Col033")
else
DTSDestination("PART_PAY_REMAINDER_DUE") = null
end if
DTSDestination("NOT_ON_SYSTEM_COURT_COST") = DTSSource("Col034")
DTSDestination("LANGUAGE_CODE") = DTSSource("Col039")
DTSDestination("AGENCY_CODE") = DTSSource("Col040")
'DTSDestination("CURRENT_COURT_DATE") = DTSSource("Col041")
If IsDate(DTSSource("Col041")) then
DTSDestination("CURRENT_COURT_DATE") = DTSSource("Col041")
else
DTSDestination("CURRENT_COURT_DATE") = null
end if
DTSDestination("VOID_REASON") = DTSSource("Col102")
DTSDestination("VOID_OPERATOR") = DTSSource("Col103")
'DTSDestination("VOID_DATE") = DTSSource("Col104")
If IsDate(DTSSource("Col104")) then
DTSDestination("VOID_DATE") = DTSSource("Col104")
else
DTSDestination("VOID_DATE") = null
end if
'DTSDestination("OFFENSE_DATE") = DTSSource("Col105")
If IsDate(DTSSource("Col105")) then
DTSDestination("OFFENSE_DATE") = DTSSource("Col105")
else
DTSDestination("OFFENSE_DATE") = null
end if
DTSDestination("COLLECTION_AGENCY_TAPE_FLAG") = DTSSource("Col106")
Main = DTSTransformStat_OK
End Function
When I first built the DTS package the commented lines failed and had
to be coded to prevent errors. So the first time I ran the DTS
package, this line failed:
'DTSDestination("PART_PAY_REMAINDER_DUE") = DTSSource("Col033")
And I needed to input this code in order to qualify the data before it
processed:
if len(trim(DTSSource("Col033"))) > 0 then
DTSDestination("PART_PAY_REMAINDER_DUE") = DTSSource("Col033")
else
DTSDestination("PART_PAY_REMAINDER_DUE") = null
end if
I am having similar problems in an SSIS package. What would the
script look like in an SSIS package?
Thanks for any help!
RBollinger |