Quantcast
Channel: SSIS – Developing Matt
Viewing all articles
Browse latest Browse all 19

SQL Transactions within SSIS. It’s like a prenuptial with your anonymous friend you met online.

$
0
0

In ssis you can set up an object (container, loop, etc) to be a transaction….you know.  I mean a sql transaction, which is really helpful when you want to be a responsible member of your organization.  So I was testing it out to see how it worked. It’s pretty simple and an easy way to make your objects perform together.

So on the container object you would set the Transaction Option to Required

And all the objects within the transaction you would set the Transaction Option to Supported (default)

The problem with this new approach is that it requires MSDTC ( or DTC to the cool kids in the know) to be turned on within the SQL Server.  This enables the server to establish a transaction that crosses over multiple databases.  Your DB kinfolk might not want this as they might want to sleep an extra 10 minutes at night.

You can also do this by just creating a sql task with a simple ‘BEGIN TRANSACTION;’ statement.

And then run your container object, followed by a ‘good’ path and an ‘evil’ path.

The good has a ‘COMMIT;’ The evil has a ‘ROLLBACK;’

You do have to set the connection property to the database connection to retain same connection

 


Viewing all articles
Browse latest Browse all 19

Latest Images

Trending Articles





Latest Images