August 20, 2008 at 5:31 am
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...
August 20, 2008 at 10:05 am
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)
August 21, 2008 at 3:47 am
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...
August 21, 2008 at 4:11 am
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
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply