SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Clarify this for me please...
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

thisisfutile
Starting Member

USA
3 Posts

Posted - 02/26/2006 :  13:32:25  Show Profile
The multi-statement example of this article shows two commands (Update and Update) in the TRAN and the corresponding explanation says:

If the statement fails after the first update, neither update statement will be applied when SQL Server is restarted. The log file will contain a BEGIN TRAN but no corresponding COMMIT TRAN.

(I assume this means the updates aren't applied to the database....allow me to continue in my confusion)

Then, further down the page the example for Create Proc has two commands (Insert and Update) and the first one fails on a primary key violation. However, the Update completes successfuly and is commited.

My confusion is that both TRANs have two commands. The 1st example says if either one fails the TRAN isn't committed. The 2nd example says the TRAN will commit the second command even though the first command fails. Is this because the TRAN in the 2nd example is part of a procedure? More directly, if the 1st example was put into the Create Proc like the 2nd example and the first update of that TRAN fails, will the second update NOW succeed and be commited?

eyechart
Flowing Fount of Yak Knowledge

USA
3575 Posts

Posted - 02/26/2006 :  13:40:11  Show Profile
what article are you referring to?



-ec
Go to Top of Page

thisisfutile
Starting Member

USA
3 Posts

Posted - 02/26/2006 :  13:50:23  Show Profile
Oops.

I read the [url=http://www.sqlteam.com/item.asp?ItemID=15583]Introduction to Transactions article [/url] and clicked comments. Then I clicked New Topic thinking it will still relate it to that article. Apparently that's not the case.

I'll repost my question at the "Comments" link for that article.

Perhaps SQL Team can disable/delete this thread.

Sorry,
Gabe
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000