Is it possible to add a Failure Workflow to a Transform Data Task?

  • I have a Transform Data Task that takes the values from a text file (each value is seperated by a "&") and imports them into a column in the Database. However there are some text files that don't have enough values in them and therefore the Task fails.

    Would it therefore be possible to attach a Failure Workflow to that Transform Data Task that points to an ActiveX Script that moves the errored file to an Errors folder? Or is there a far simpler way of doing this that i'm not aware of?

    Thanks for any replies in advance...

  • Hi,

    If you create your ActiveX script to move the file you should then be able to create the failure workflow between the destination of the transform task and the script object.

    :o)



    Ade

    A Freudian Slip is when you say one thing and mean your mother.
    For detail-enriched answers, ask detail-enriched questions...[/url]

  • Thanks for the reply Ade,

    Unfortunately this still does not work. It still complains that a column is missing then stops the package instead of going to the Failure task.:crazy:

    Will have to play around with the work flow options and see what the craic is...

  • Are you using T-SQL to call the execution of the package, if so you can capture the return value of the execution and use xp_cmdshell to move the file on failure:

    DECLARE @rc INT

    DECLARE @sourceFilePath VARCHAR(200)

    DECLARE @failedFilePath VARCHAR(200)

    DECLARE @command VARCHAR(200)

    SELECT @failedFilePath = '\\share\folder\subfolder\failed\'

    EXEC @rc = master.dbo.xp_cmdshell 'DTSRun .....'

    IF @rc <> 0

    BEGIN

    SELECT @command = 'MOVE ' + @sourceFilePath + ' ' + @failedFilePath

    EXEC master.dbo.xp_cmdshell

    END

    HTH



    Ade

    A Freudian Slip is when you say one thing and mean your mother.
    For detail-enriched answers, ask detail-enriched questions...[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply