dbTalk Databases Forums  

Converting a DTS job to SSIS

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


Discuss Converting a DTS job to SSIS in the microsoft.public.sqlserver.dts forum.



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

Default Converting a DTS job to SSIS - 10-10-2008 , 07:59 AM






Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function

Reply With Quote
  #2  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM






Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


Reply With Quote
  #3  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM



Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


Reply With Quote
  #4  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM



Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


Reply With Quote
  #5  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM



Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


Reply With Quote
  #6  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM



Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


Reply With Quote
  #7  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM



Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


Reply With Quote
  #8  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM



Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


Reply With Quote
  #9  
Old   
Todd C
 
Posts: n/a

Default RE: Converting a DTS job to SSIS - 10-10-2008 , 11:24 AM



Looks like you need a Script transform in your data flow.

Define the input columns by clicking them from the list. Then define the
Output columns by manually defining them in the Input and Output tab. Finally
in the Script tab, click the Design Script button.

You can refer to the columns as:
Row.<input_Column>
and
Row.<Output_Column>

HTH
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"robboll" wrote:

Quote:
Newby here:

Where do you do VB Transformations in SSIS? Like this???

thanks!

'************************************************* *********************
' Visual Basic Transformation Script
' Copy each source column to the
' destination column
'************************************************* ***********************

Function Main()
DTSDestination("FORM-NUMBER") = DTSSource("Col001") +
DTSSource("Col002") + DTSSource("Col003")
DTSDestination("FORM-YEAR") = DTSSource("Col001")
DTSDestination("WA-JOB-NUM") = DTSSource("Col006")
DTSDestination("DISTRICT") = DTSSource("Col007")
DTSDestination("WORK-DISTRICT") = DTSSource("Col008")
' DTSDestination("WORK-DATE") = DTSSource("Col009")

If IsDate(mid(DTSSource("Col009"),1,4) & "/" &
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2))
then
DTSDestination("WORK-DATE") = mid(DTSSource("Col009"),1,4) & "/" &
_
mid(DTSSource("Col009"),5,2) & "/" & mid(DTSSource("Col009"),7,2)
else
DTSDestination("WORK-DATE") = null
end if

DTSDestination("ACT-PREFIX") = DTSSource("Col010")
DTSDestination("ACT-CODE") = DTSSource("Col011")
Main = DTSTransformStat_OK
End Function


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.