August 7, 2013 at 10:31 pm
I have some doubts related to transactions in SQL.
Connection 1 open for DB1 database
Begin transaction for Connection 1
Run the commands on Connection 1
Connection 2 open for DB2 database
Begin transaction for Connection 2
Run the commands on Connection 2
Commit transaction for Connection 2
Commit transaction for Connection 1
If commit transaction on Connection 1 fails(rollback) then transaction on connection 2 should rollback.
Is it possible? How it can be done?
August 8, 2013 at 12:07 am
This is a good start on the subject:
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
August 8, 2013 at 1:35 am
Koen Verbeeck (8/8/2013)
This is a good start on the subject:
We tried to implement it.But if inner transaction gets commit first.I want inner transaction to roll backup if outer transaction gets failed(rollback).
In coding we are using 'SqlConnection' object. So if you have any example let me know.
August 8, 2013 at 1:45 am
IT researcher (8/8/2013)
Koen Verbeeck (8/8/2013)
This is a good start on the subject:We tried to implement it.But if inner transaction gets commit first.I want inner transaction to roll backup if outer transaction gets failed(rollback).
In coding we are using 'SqlConnection' object. So if you have any example let me know.
The article has an example. If you nest transactions, the outer transaction will rollback the inner transaction.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
August 8, 2013 at 5:41 am
Does nested transactions only supported in Transaction Statements(Transact-SQL ) ? In coding i am using 'sqlconnection' object. But inner transaction gets comited even though outer transaction fails
August 8, 2013 at 5:46 am
IT researcher (8/8/2013)
Does nested transactions only supported in Transaction Statements(Transact-SQL ) ? In coding i am using 'sqlconnection' object. But inner transaction gets comited even though outer transaction fails
Don't you send TSQL statements to the database over the sqlconnection?
Maybe you should post your code.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply