Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8549045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:38:08+00:00 2026-06-11T13:38:08+00:00

In general, I just want to be able to do this: begin transaction begin

  • 0

In general, I just want to be able to do this:

begin transaction
begin transaction
select 'x'
rollback
rollback

The reason is, I have a stored proc with code like this:

begin transaction

--Do stuff

If(problem)
begin 
    rollback
end else begin
    commit
end

It works just like I want it to, but I want to test it by doing this:

begin transaction
exec MyStoredProc
rollback

When the stored proc executes a rollback it seems to close both transactions, and then my rollback outside the stored proc fails.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:38:09+00:00Added an answer on June 11, 2026 at 1:38 pm

    There is no such thing as an autonomous transaction in SQL Server. Nesting transactions serves to increase @@TRANCOUNT, but that’s about it. As @marc_s suggested in his comment, ROLLBACK does not apply solely to the current transaction scope/level, it applies to the whole thing.

    This request was rejected in 2008:

    http://connect.microsoft.com/SQLServer/feedback/details/324569/add-support-for-true-nested-transactions

    However, this request is still active – so maybe there is hope:

    http://connect.microsoft.com/SQLServer/feedback/details/296870/add-support-for-autonomous-transactions

    As for your outer rollback failing, you can always check for this first instead of doing it blindly, e.g.:

    IF @@TRANCOUNT > 0
      ROLLBACK TRANSACTION;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i just want to know a general information about this particular information. Any good
I just started using php arrays (and php in general) I have a code
I have the following url http://www.domain.com?page=options&tab=general I want to be able to get to
Just a general curiosity question. Why is this namespace System.Collections.Generic added by default in
just a general question, do you ALWAYS have to handle error? i was just
MSDN is a nice place to get vague, general information on this, with just
I have an interface like this: public interface BatchSynchronisedPool<R extends Runnable> { void execute(R
I have a method which is running very long. I want to be able
I have a question that doesn't need any specific answer, just a general direction
just have a general question that came up while I was playing around with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.