all groups > sql server dts > april 2006 >
You're in the

sql server dts

group:

Exiting the DTS pacakge successfully


Exiting the DTS pacakge successfully Bhaskar
4/6/2006 11:01:01 AM
sql server dts:
Hi,
I have created a DTS package to load the data from the one server to
another server. To load this data i have one Flag which is defined in the
desitination server table. If this flag is 1 then i have to load the data,
other wise i have to exit the dts package sucessfully. to do this i have
created the two activex scripts and using this. i am exectuing this from the
job. looks like this is giving the job failed message.

My flow is something like below

IF Script 1 is Success then it will execute the other tasks and load the
data.
IF Script 1 is Failure then it will excute the Script2.

Active script 1:

Function Main()
Dim isLoadBudgetFlag

isloadFlag= DTSGlobalVariables("isloadFlag").Value
IF isloadFlag=1 THEN
Main = DTSTaskExecResult_Success
ELSE
Main = DTSTaskExecResult_Failure
END IF

End Function

Active script 2:

Function Main()
'msgbox("Failed Successfully")
Main = DTSTaskExecResult_Success
End Function



i want to exit successfully..

Thanks in advance
Bhaskar
Re: Exiting the DTS pacakge successfully Allan Mitchell
4/9/2006 1:53:45 PM
Hello Bhaskar,


Easy enough

In your package at the start you have an ExecuteSQL task which reads for
the table and gets the value into a GV.


In an Active Script task you test this value.

You have two paths from the task.

1. Loads the data
2. Exits

Both are "On Success"

You simply enable and disable the corect tasks.

Have a look at code section 4 in this article for ideas


http://www.sqldts.com/default.aspx?246


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button