Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 reseting status in DTS loop

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-05-01 : 12:39:02
Erik writes "My DTS loop functions to cycle through a directory and as long as there are available *.csv files, it transforms the data into a table. I have added failure handling for when it is unsuccessful at adding to the table. I would like the loop to continue even after a data transform failure.

A common error happens after the data does not meet a foreign key relationship in the destination table. When this fails, the succeeding loop cycles fail in the same spot as well. I presume what is happening is the execution status on the previously failed step is not reset, so the next time through the loop it follows the failure path.

Here is the order of operations:
1) Start Loop if *.csv files found
2) Copy file found to FileToSave.csv
3) Move file found to *.tmp (This step is done to create a backup of the file before processing)
4) Data transform FileToSave.csv
5) if error then rename *.tmp to *.err -> Restart Loop
6) if successful then delete *.tmp -> Restart Loop

So, I am guessing that it has something to do with the execution status or precendence basis needing to be reset after a failure (or everytime through the loop)...

thanks for your help!"
   

- Advertisement -