Suppose that we are creating this small pakage
This above package will definetly fail if we set the Sequence container TransactionOption property to required. In the other hand, if we move the first create data base task out of the sequence container then the data base will be created even if the sequence container fails
To tewak that, I decided to add a new Execute Sql Task just after the sequence container, as bellow
DECLARE @dbase_id int;
SET @dbase_id @dbase_id = DB_ID(N'FIRM');
IF @dbase_id IS NOT NULL --The data base name is FIRM
BEGIN
DROP DATABASE FIRMEND
GO
Of Corse, the constraint has to be changed to failure. As we need to drop the data base only when the sequence container is failed.
Hope that helps to tweak arround the problem.
Thanks. That was helpful.
ReplyDelete