SQL error

Delete from uniqueatts;
Delete from ATTRIBUTES;
Delete from itemattributions;
Commit;

I tried to run the above queries on SQL database but the following error occured.

0 row(s) affected)

(0 row(s) affected)

(1106 row(s) affected)

(827 row(s) affected)

(13798 row(s) affected)

(8278 row(s) affected)

(6309 row(s) affected)
Msg 3902, Level 16, State 1, Line 4
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.

Any suggestions what to do?
SANbuddiesAsked:
Who is Participating?
 
LowfatspreadCommented:
i suggest that you

initially look for triggers (DELETE) on the tables/views that you're operating on.

secondly    investigate why the script has a commit without a begin tran...
0
 
sdstuberCommented:
looks like you have other stuff in your window.  So your commit doesn't appear to apply to the statements you are showing

You are only showing 3 deletes, but you have 7 results.
0
 
Barry CunneyCommented:
there is a COMMIT at the end of the SQL statements but no matching begin tran

Normally if SQL statements are to be run in a transction you would have

BEGIN TRAN
   DELETE.....

COMMIT TRAN
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you have a trigger in a table, which is doing "recursive" work, and somewhere there is a COMMIT without a BEGIN, or a ROLLBACK ...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.