Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL 2008 - Nested transactions

SQL 2008 - Nested transactions

Scheduled Pinned Locked Moved Database
helpdatabasequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ofirbt
    wrote on last edited by
    #1

    Hello, I have this structure : CREATE PROCEDURE external_sp AS BEGIN BEGIN TRANSACTION EXEC internal_sp @param1,@result out if( @result <> 1 ) BEGIN COMMIT TRANSACTION END ELSE BEGIN ROLLBACK TRANSACTION END END The problem : inside the stored procedure "internal_sp" there is another BEGIN TRANSACTION block. If this internal transaction block get rolled back, the outer transaction (in the external_sp stored procedure) fails. How can i solve this issue ?? Any help will be appreciated...

    M 1 Reply Last reply
    0
    • O ofirbt

      Hello, I have this structure : CREATE PROCEDURE external_sp AS BEGIN BEGIN TRANSACTION EXEC internal_sp @param1,@result out if( @result <> 1 ) BEGIN COMMIT TRANSACTION END ELSE BEGIN ROLLBACK TRANSACTION END END The problem : inside the stored procedure "internal_sp" there is another BEGIN TRANSACTION block. If this internal transaction block get rolled back, the outer transaction (in the external_sp stored procedure) fails. How can i solve this issue ?? Any help will be appreciated...

      M Offline
      M Offline
      masoumeh2010
      wrote on last edited by
      #2

      Hello, If you use internal transaction you don't need to use another transactions.

      O 1 Reply Last reply
      0
      • M masoumeh2010

        Hello, If you use internal transaction you don't need to use another transactions.

        O Offline
        O Offline
        ofirbt
        wrote on last edited by
        #3

        ?! And if i really need to nest transactions ??

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups