Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

DTS Package Error Handling

I am writing a vbscript active script to generate some files.  I would like to stop the creation of file when it encounters an error. Are there any examples of that anybody can share with me?  Right now what happens is that it creates the file (probably in the middle) and then stops the DTS package...  I would like to stop if from creating the file at all...  I may have to move the save file code to somewhere else...
0
RVattakunntel
Asked:
RVattakunntel
  • 4
  • 2
  • 2
2 Solutions
 
AaronAbendCommented:
I think you can set up a workflow "failure" step and go from that step on failure and take action as needed. Sorry I cannot even open my old dts packages since upgrading to 2005.
0
 
RVattakunntelAuthor Commented:
ok.  I have a sendmail task if the active x script fails but I want to fail the dTS package if certain error occurs.
0
 
AaronAbendCommented:
I suggest deleting the file in the process that fires when it fails... there should be a way to do that in activex. You may have to create a DOS command and RUN it or something like that.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
Anthony PerkinsCommented:
If there is an error the file is not created.
0
 
RVattakunntelAuthor Commented:
That is not a bad idea to delete the file when an error occurs.  Any examples of vbscript in doing that?
0
 
AaronAbendCommented:

set oFile = oFSO.GetFile(sFilename)
oFile.Delete(True)

I think this does it
0
 
AaronAbendCommented:
wrong ... check this out

http://www.sqlservercentral.com/columnists/hji/usingvbscripttoautomatetasks.asp

(without access to dts any more it is hard to help.. but for that same reason, I know there are not many dts guys left out there so I am just trying to help as much as I can)
0
 
Anthony PerkinsCommented:
Or simply:

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "YourFileNameGoesHere", True
Set FSO = Nothing
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now