Transaction on SSIS
Hi,
I have execute SQL task followed by Data Flow task then in that i will pick source row count and destination row count, check whether they both much, if they match then truncate source table.
What i need now is if source row count <> destination row count than roll back the transaction, how can i achieve it in SSIS.
Regards,
NavinNavin.D http://dnavin.wordpress.com
May 16th, 2012 5:20am
http://www.mssqltips.com/sqlservertip/1585/how-to-use-transactions-in-sql-server-integration-services-ssis/Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Free Windows Admin Tool Kit Click here and download it now
May 16th, 2012 5:28am
Navind,
You can do it in SSIS. Put your tasks in in Sequence container and set the
TRANSACTION property of the sequence container to REQUIRED.
When this property is set, and if any of the tasks inside the sequence container fails it rollback the transaction.
For your case, use conditional split to make two path for success and failure. To the downline of failure, keep task and fail it explicitly. This will fail sequence container and also rollbacks the transactions done inside sequence container.Bunch of thanks ~ Deva ~ mark it as answer if it answered your question :)
May 16th, 2012 5:52am
Hello,
Along with the link provided by Uri also check the link below. It may help you.
http://microsoft-ssis.blogspot.com/2011/01/ssis-transactions.html
Free Windows Admin Tool Kit Click here and download it now
May 16th, 2012 6:10am
Hi,
I used sequence container and placed everything in it, it taking for every now :(. it stuck at data flow it don't move any further down the sequence.
Regards,
NavinD
Navin.D http://dnavin.wordpress.com
May 16th, 2012 6:12am
ValidateExternalMetadata to False did
help to move forwardNavin.D http://dnavin.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
May 16th, 2012 6:23am
hi
if you want transation you can put sequence container set transation property is required.
other wise you want compare row count manuvally.
follw these steps:
1)take two row count transformation,compare two count and then truncate table data.
indu
May 16th, 2012 6:36am