// SQL Server error reference

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
Error message
The statement has been terminated.

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

  1. Look at the error just before 3621 and fix that one.

  2. 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

More transactions and locking errors

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.

// fewer errors, faster fixes

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.