dbTalk Databases Forums  

Task not executed when package failed

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


Discuss Task not executed when package failed in the microsoft.public.sqlserver.dts forum.



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

Default Task not executed when package failed - 06-15-2005 , 11:21 AM






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

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

Default Re: Task not executed when package failed - 06-15-2005 , 03:09 PM






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

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



Reply With Quote
  #3  
Old   
Matt Temple
 
Posts: n/a

Default Re: Task not executed when package failed - 06-16-2005 , 05:40 PM



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

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



Reply With Quote
  #4  
Old   
Chris
 
Posts: n/a

Default Re: Task not executed when package failed - 06-16-2005 , 11:38 PM



Thanks!

"Allan Mitchell" wrote:

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




Reply With Quote
  #5  
Old   
Chris
 
Posts: n/a

Default Re: Task not executed when package failed - 06-16-2005 , 11:38 PM



Hi,
Allan's suggestion seems to be the solution. I am still trying to get it to
work using the info from the link he provided.

Thanks

"Matt Temple" wrote:

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




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.