views:

34

answers:

2

There is a SP which gets over 96 items as parameters. I want to debug this sp, how can I do it?

It says:

Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0." System.Data.Common.DbException {System.Data.SqlClient.SqlException}

Please tell me a way to find this error? I will give more details the more answers come..

+2  A: 
abatishchev
+1  A: 

Forget about the number of parameters... start going through the code and counting the BEGIN entries as a +1 and COMMIT entries as a -1.. when you get to a place where your count is a -1, you found the error. Or, if you get to the end and your count isn't 0, there's your error. Every begin must have one commit.

Fosco