dbTalk Databases Forums  

Exiting the DTS pacakge successfully

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


Discuss Exiting the DTS pacakge successfully in the microsoft.public.sqlserver.dts forum.



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

Default Exiting the DTS pacakge successfully - 04-06-2006 , 01:01 PM






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


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Exiting the DTS pacakge successfully - 04-09-2006 , 03:53 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

Quote:
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



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.