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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Nested Transactions

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-16 : 15:16:10
Afam writes "I get the following error

"Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 2"

when I do the following;

PROC 1
...
BEGIN TRANSACTION

EXEC proc 2
IF error
BEGIN
ROLLBACK TRANSACTION
RETURN
END

COMMIT TRANSACTION
RETURN
------------------------------------------------------

PROC 2
...
BEGIN TRANSACTION
...
IF error
BEGIN
ROLLBACK TRANSACTION
RETURN
END

COMMIT TRANSACTION
RETURN
------------------------------------------------------

The error occurs in PROC 2. What am I doing wrong? Does SQL Server permit nested Transactions across stored procedures? I appreciate yuor assistance!
"
   

- Advertisement -