MSSQLMSSQL 3621

MSSQL 3621: The Statement Has Been Terminated

SQL Server error 3621 is always a secondary message that accompanies another error. It means the statement was aborted because a preceding error (such as a constraint violation) made it impossible to continue.

Example Query

INSERT INTO users (id, email) VALUES (1, 'dup@example.com');
-- Error 2627: duplicate key
-- Error 3621: statement terminated

Common Causes

  1. 1Constraint violation (unique, foreign key, NOT NULL) aborting the statement
  2. 2Arithmetic error (divide by zero, overflow) within the statement
  3. 3Trigger raising an error inside the statement execution

How to Fix It

Fix the root cause error that appears before 3621 in the error output — 3621 itself is just a notification. Wrap statements in TRY/CATCH blocks in T-SQL to handle errors gracefully and provide meaningful feedback.

Need a reliable database?

Try Supabase — free PostgreSQL with a generous free tier. No credit card required.

Get started free →

Got a query causing this error?

Paste it into SQLbuddy and get an instant plain-English explanation with optimization tips.

Analyze My Query →