July 6, 2011 at 10:52 pm
Hi ,
i have migrated from sql2000 dts package to ssis package (sql2008). i tried to execute the package in 2008. it's getting error. The following vb script code does not support in ssis package.
-------------- Vb script code -------------------
Function Main()
If DTSGlobalVariables("SegmentationID").Value <> 0 Then
'Record exists so enable next step and let package run
DTSGlobalVariables.Parent.Steps("DTSStep_DTSExecuteSQLTask_1").DisableStep = 0
'Disable Error Notification
DTSGlobalVariables.Parent.Steps("DTSStep_DTSSendMailTask_CheckTaskMailError").DisableStep = -1
Else
'No record exists so disable the next step and let package complete sucessfully
DTSGlobalVariables.Parent.Steps("DTSStep_DTSExecuteSQLTask_1").DisableStep = -1
'Enable Error Notification
DTSGlobalVariables.Parent.Steps("DTSStep_DTSSendMailTask_CheckTaskMailError").DisableStep = 0
End If
Main = DTSTaskExecResult_Success
End Function
Could you please let me know, if any other alternate way to rewrite the code
Thanks in advance
Balaji G
July 8, 2011 at 10:05 am
This is a fundamental change from DTS to SSIS. You cannot modify other objects in the package directly either from activex or script tasks. What you are trying to do is a disable/enable. Probably the easiest way to do this is with expressions. You would need two variables for your process, you then use the script task to evaluate SegmentationID and set the value to true or false.
I built a really quick sample of what I'm talking about.. HERE
CEWII
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply