30
Views
4
Comments
Solved
Getting an error while running SQL Update query

It does update the record in table but it gives below error and exit the process.

Query:-

Update  {APIRequestTbl} set {APIRequestTbl}.[StatusCount] = @setVal where  {APIRequestTbl}.[Id] = @RecID;

EXECUTE('COM'+'MIT');

Error:-

Database returned the following error: Error in advanced query SQL1: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0. Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0. 

Solution

Remove the strange EXECUTE('COM'+'MIT'); 

Your SQL will be committed automatically when the serveraction where it is in is completed.

If you want to force a commit, place the CommitTransaction serveraction just after your SQL

Solution

Hi Erwin,

Thanks its working

Solution

Great to hear it is working! Can you mark the answer as a solution, so other people can also learn from it?

Solution

Great to hear it is working! Can you mark the answer as a solution, so other people can also learn from it?

Hello Ayesha Shah, 

This is a repeated post. Please delete it.

Best regards, 

Ana


Solution

Remove the strange EXECUTE('COM'+'MIT'); 

Your SQL will be committed automatically when the serveraction where it is in is completed.

If you want to force a commit, place the CommitTransaction serveraction just after your SQL

Solution

Hi Erwin,

Thanks its working

Solution

Great to hear it is working! Can you mark the answer as a solution, so other people can also learn from it?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.