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
 General SQL Server Forums
 New to SQL Server Programming
 Begin tran/commit tran

Author  Topic 

satfaltu
Starting Member

2 Posts

Posted - 2010-07-15 : 08:55:45
If I write begin tran t1 inside a proc, does the transaction really named as 't1'? The reason I am asking this is - I have a proc inside which I have begin tran t1/commit tran t2 and it works fine.

I think only count of 'tran' matters. Can someone pls clarify?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-07-15 : 09:12:49
No. SQL Server does not have autonomous transaction.
You can have many BEGIN TRAN, but when the first ROLLBACK TRAN occurs, all transactions are rolled back. Not only back to the latest BEGIN TRAN. All transactions.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

satfaltu
Starting Member

2 Posts

Posted - 2010-07-15 : 09:17:02
Thanks for your reply.

My question is - if I write begin tran t1, does the name (t1) really matters? I am beginning a tran like begin tran t1 and calling commit tran t2, then also it works. So how is this possible?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-15 : 09:57:39
You can rollback / commit to named save point

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=141905#557001
Go to Top of Page
   

- Advertisement -