ALTER DATABASE compatibility level
changes database compatibility level (no row flow)
What changes
- Input
- catalog
- Output or change
- catalog: database compatibility level
Syntax at a glance
ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = { 170 | 160 | 150 | 140 | 130 | 120 | 110 | 100 | 90 | 80 }
Work example
A database is being evaluated for compatibility level 170 or another supported level.
Compare Query Store plans and application results on a restored copy before changing production.
Check your work The selected level is supported by the engine and critical query plans meet their agreed limits.
Open Microsoft Learn for full syntax, permissions, and details for your version.