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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

Starting Member

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?

Flowing Fount of Yak Knowledge

3575 Posts

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

Go to Top of Page

Starting Member

3 Posts

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

I read the [url=]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.

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