Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 commit transcation

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2010-06-04 : 03:31:39
Hi,
iam inserting a data through stored procdure and i did commit that transaction, but i need to rollback that transactions.
my questions is that can i rollback that commit transactions.

Looking ur valuable reply

Desikankannan

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-04 : 04:07:28
You can't ROLLBACK a commited transaction.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-04 : 05:27:54
If you had an outer wrapper transaction, and an inner transaction within the SProc, then the code in the outer transaction could rollback - and that would rollback the part transaction COMMITted by the SProc. But you would have to use SAVEPOINTS in your SProc - if you just say "COMMIT" then that is the whole transaction ... including the OUTER transaction

(Well, I think that's how it works! we certainly use SAVEPOINTS in all SProcs in order that any outer code can handle "wider" transactions as it sees fit.
Go to Top of Page
   

- Advertisement -