General discussion

Locked

Rollback a DTS-package

By jaak.stappers ·
Hello
We run several DTS-packages on an SQL server 2000 during the night.
Each package updates several tables by first dropping them, then creating new instances and finally copying the data from the source into them.
The problem is that the connection to the source is established after the drop and the creation. So, when this connection can't be established, the new tables contain 0 records.
Can somebody tell me how I can rollback the package or how I can test on the connection the source prior to the drop and creation and cancel the package if the connection fails.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Well you need

by Tony Hopkinson In reply to Rollback a DTS-package

you need to wrap the drop, create an insert into one transaction.
Start Transaction
...
COMMIT
or RollBack

You might find it easier to rename the tables instead.
Drop all OLD_COPY_... if they exist
Rename existing to OLD_COPY_...
If Create & populate
Unsuccessful - Delete existing and rename back
Bit old school, but solid and you have all the old data still available until teh next time the package executes, which is a bonus if you can afford the disk space

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums