SQL Server error 3621: The statement has been terminated
An informational follow-up: the statement before it failed and was rolled back. The real error is the message printed just above 3621.
- Error number
3621- Severity
- 10
- Category
- Transactions and locking
What it means
Error 3621 has severity 10, so it is informational. SQL Server prints it after a statement-level error, such as a constraint violation (2627, 547, 515) or truncation (8152), to say that the failing statement was stopped and its changes undone. Whether the rest of the batch and the surrounding transaction continue depends on the original error and on XACT_ABORT.
Common causes
- Any error that terminates a single statement, most often 2627, 2601, 547, 515, 8152 or 2628.
How to fix it
-
Look at the error just before 3621 and fix that one.
-
Remember that only the failed statement was undone: earlier statements in an open transaction are still pending until you commit or roll back.
SELECT @@TRANCOUNT AS open_transactions;
Related errors
2627Violation of PRIMARY KEY or UNIQUE KEY547Statement conflicted with a constraint515Cannot insert the value NULL into column8152String or binary data truncated
More transactions and locking errors
266Transaction count mismatch after EXECUTE1205Deadlocked and chosen as the victim1222Lock request time out period exceeded3930Transaction cannot be committed3902COMMIT has no corresponding BEGIN3903ROLLBACK has no corresponding BEGIN3609Transaction ended in the trigger3960Snapshot isolation update conflict
The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.
Work on SQL Server in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.