Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop DTS package without error

Status
Not open for further replies.

CodingIsFun

Programmer
Apr 9, 2004
134
US
Hi all experts,

I have currently created a DTS package that runs some sql tasks. Each task runs a stored procedure which will raise an error if an item is missing.

This package is being initiated by a sql job and reports that there was an error. All the errors are being logged within the DTS package. With this in mind, I want a way for the Job Status to report that the package was successful instead of error. Is there anyway to do this.

I am using MS sql 2000 sp4.

thanks in advance..
 
I usually just add a step at the end with an SMTP email job that emails me if the job ended successfully. SMTP ensures I never have to worry about the Exchange server being available and if I don't get the email, I know something is wrong.

Of course, I include fail mails too.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Catadmin: Thats not the issue. The reason why I want it to report non-failure or success is because I have other packages I want to run after it within the same job, and I want to be able to determine if there is a real failure from a false positive.

-thanks for you input.
 
How are you capturing the errors? With @@Error? Or with some other method?



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
I found what I needed, here it is for reference just incase someone else needs to do the same things

I created an active-xscript with to successors and just deactive the one I dont want.


'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()

Dim pkg
Dim stpContinuePkg
Dim stpExitNoAttachment

' First thing we need to do is evaluate the email pop process

SET pkg = DTSGlobalVariables.Parent

SET stpContinuePkg = pkg.Steps("DTSStep_DTSActiveScriptTask_5")
SET stpExitNoAttachment = pkg.Steps("DTSStep_DTSActiveScriptTask_4")

If DTSGlobalVariables("zipfile_name").Value = "error" Then
stpContinuePkg.DisableStep = True
stpExitNoAttachment.DisableStep = False
Else
stpContinuePkg.DisableStep = False
stpExitNoAttachment.DisableStep = True

end if


Main = DTSTaskExecResult_Success
End Function

thanks again for looking into this...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top