sp_addarticle generates "Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements."

  • Hi all,

    I'm a newbie with SQL Server so forgive me if this is a somewhat stupid question but I already searched for a answer without much success.

    I have a procedure that builds the SQL statements to build a table, build the keys, indexes and constraints. Once this is executed, the sp_addarticle is executed to add the table to a already setup SQL Server Replication. The procedure does not feature a single commit or rollback. All it does are DML statements.

    Once executed in the Management Studio, it runs without any issues. The problem is when it is executed via .Net WCF it returns the following error:

    "Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 2.

    Uncommittable transaction is detected at the end of the batch. The transaction is rolled back."

    If the sp_addarticle is commented out, it runs without any issue.

    Do you have any clue or tip for me to debug this?

    Thanks for your time in advance.

    Regards,

    Vรญtor

  • Thanks for the reply! ๐Ÿ™‚

  • vitor8pinto (3/19/2010)


    Thanks for the reply! ๐Ÿ™‚

    So...did you solve it? Was it a trigger?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply