![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, How can I execute a mail task on when a package fail. Currently I have a package that imports a file into my database. I have an activex script task that chacks if the file exists, It has the foll code Function Main() Dim oFSO, sFileName ' Get the name of the file from the Connection "Text File (Source)" sFilename = "c:\test.txt" Set oFSO = CreateObject("Scripting.FileSystemObject") ' Check for file and return appropriate result If oFSO.FileExists(sFilename) Then Main = DTSTaskExecResult_Success Else Main = DTSTaskExecResult_Failure End If Set oFSO = Nothing End Function I then have a workflow connection (on failure) to a mail task. I then changes the name of the file to case a failure but it doesn't execute the mail task. It shows the error ...:Package failed because Step 'DTSStep_DTSActiveScriptTask_1' failed. Any ideas? Thanks |
#3
| |||
| |||
|
|
Hi, How can I execute a mail task on when a package fail. Currently I have a package that imports a file into my database. I have an activex script task that chacks if the file exists, It has the foll code Function Main() Dim oFSO, sFileName ' Get the name of the file from the Connection "Text File (Source)" sFilename = "c:\test.txt" Set oFSO = CreateObject("Scripting.FileSystemObject") ' Check for file and return appropriate result If oFSO.FileExists(sFilename) Then Main = DTSTaskExecResult_Success Else Main = DTSTaskExecResult_Failure End If Set oFSO = Nothing End Function I then have a workflow connection (on failure) to a mail task. I then changes the name of the file to case a failure but it doesn't execute the mail task. It shows the error ...:Package failed because Step 'DTSStep_DTSActiveScriptTask_1' failed. Any ideas? Thanks |
#4
| |||
| |||
|
|
Why bother to fail the task? Have workflow and redirect the flow of control Multiple Paths in Workflow (http://www.sqldts.com/default.aspx?218) -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:F7A7B0D6-100F-4BA3-BCBE-11F33F05D384 (AT) microsoft (DOT) com... Hi, How can I execute a mail task on when a package fail. Currently I have a package that imports a file into my database. I have an activex script task that chacks if the file exists, It has the foll code Function Main() Dim oFSO, sFileName ' Get the name of the file from the Connection "Text File (Source)" sFilename = "c:\test.txt" Set oFSO = CreateObject("Scripting.FileSystemObject") ' Check for file and return appropriate result If oFSO.FileExists(sFilename) Then Main = DTSTaskExecResult_Success Else Main = DTSTaskExecResult_Failure End If Set oFSO = Nothing End Function I then have a workflow connection (on failure) to a mail task. I then changes the name of the file to case a failure but it doesn't execute the mail task. It shows the error ...:Package failed because Step 'DTSStep_DTSActiveScriptTask_1' failed. Any ideas? Thanks |
#5
| |||
| |||
|
|
Hi Chris! If you haven't set up SQL to send mail yet, try looking over this FAQ from MS: http://support.microsoft.com/default...311231&sd=tech Otherwise, first try sending a test message through a DTS where the only task is to send an email to yourself. If that works, it's got to be something within the DTS package you're experiencing a problem with. If that's the case, try writing a text file instead of sending an email. This will allow you to test whether or not the ActiveX task has failed or succeeded. I know the above isn't a resolution and more just troubleshooting, but I hope it helps. <hi5 "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:F7A7B0D6-100F-4BA3-BCBE-11F33F05D384 (AT) microsoft (DOT) com... Hi, How can I execute a mail task on when a package fail. Currently I have a package that imports a file into my database. I have an activex script task that chacks if the file exists, It has the foll code Function Main() Dim oFSO, sFileName ' Get the name of the file from the Connection "Text File (Source)" sFilename = "c:\test.txt" Set oFSO = CreateObject("Scripting.FileSystemObject") ' Check for file and return appropriate result If oFSO.FileExists(sFilename) Then Main = DTSTaskExecResult_Success Else Main = DTSTaskExecResult_Failure End If Set oFSO = Nothing End Function I then have a workflow connection (on failure) to a mail task. I then changes the name of the file to case a failure but it doesn't execute the mail task. It shows the error ...:Package failed because Step 'DTSStep_DTSActiveScriptTask_1' failed. Any ideas? Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |