dbTalk Databases Forums  

Simple DTS to SSIS conversion?

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


Discuss Simple DTS to SSIS conversion? in the microsoft.public.sqlserver.dts forum.



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

Default 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

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.