SQL Interview: 112 Trigger and constraint execution order

SQL Interview: 112 Trigger and constraint execution order

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Development Level: Medium

Question:

You have tables that have both constraints and triggers. You need to explain the order of execution for these. Which execution order (from first to last), are used for:

  • Check constraints
  • After triggers
  • Instead of triggers

Answer:

These are executed in the following order:

  1. Instead of triggers
  2. Check constraints
  3. After triggers

2026-01-18