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.
| Author |
Topic |
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-07-29 : 07:30:33
|
| Hello All,I have 2 Sps (say SP1 and SP2) , SP2 is called from SP1(and ofcourse SP1 is main SP).SP1 has it's own transaction and SP2 has its own transaction.When I execute SP1, if no error occures then it works ok.If any error exists the follwoing message is shownThe ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION Sample Code For Both SP is given below:Create PROCEDURE SP1ASBEGIN BEGIN TRY BEGIN TRANSACTION --Some Queries exec SP2 COMMIT TRANSACTION END TRY BEGIN CATCH ROLLBACK END CATCH ENDCreate PROCEDURE SP2ASBEGIN BEGIN TRY BEGIN TRANSACTION --Some Queries COMMIT TRANSACTION END TRY BEGIN CATCH ROLLBACK END CATCH ENDThank you in advance.Regard's Yasir Mehmood |
|
|
VGuyz
Posting Yak Master
121 Posts |
Posted - 2008-07-29 : 07:49:16
|
| Create PROCEDURE SP1ASBEGINBEGIN TRANSACTION BEGIN TRY --Some Queries COMMIT TRANSACTION END TRY BEGIN CATCH ROLLBACK END CATCHENDChk this.., |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
|
|
|