Skip to content

Commit d93579c

Browse files
authored
Merge pull request #5595 from jodebrui/patch-62
clarification about compat level of distribution DB
2 parents aba6833 + d59b13f commit d93579c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/t-sql/statements/alter-database-transact-sql-compatibility-level.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ SET COMPATIBILITY_LEVEL = { 140 | 130 | 120 | 110 | 100 | 90 }
6868
|SQL Server 2000|8|80|80|
6969

7070
> [!NOTE]
71-
> **Azure [!INCLUDE[ssSDS](../../includes/sssds-md.md)]** V12 was released in December 2014. One aspect of that release was that newly created databases had their compatibility level set to 120. In 2015 SQL Database began support for level 130, although the default remained 120.
72-
>
7371
> As of **January 2018**, in SQL Database, the default compatibility level is 140 for newly created databases. We do not update database compatibility level for existing databases. This is up to customers to do at their own discretion. With that said, we highly recommend customers plan on moving to the latest compatibility level in order to leverage the latest improvements.
7472
>
7573
> If you want level 140 for your database generally, but you have reason to prefer the level 110 **cardinality estimation** algorithm, see [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](../../t-sql/statements/alter-database-scoped-configuration-transact-sql.md), and in particular its keyword `LEGACY_CARDINALITY_ESTIMATION = ON`.
@@ -94,6 +92,9 @@ SELECT name, compatibility_level FROM sys.databases;
9492

9593
## Remarks
9694
For all installations of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], the default compatibility level is set to the version of the [!INCLUDE[ssDE](../../includes/ssde-md.md)]. Databases are set to this level unless the **model** database has a lower compatibility level. When a database is upgraded from any earlier version of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], the database retains its existing compatibility level if it is at least minimum allowed for that instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Upgrading a database with a compatibility level lower than the allowed level, sets the database to the lowest compatibility level allowed. This applies to both system and user databases. Use **ALTER DATABASE** to change the compatibility level of the database. To view the current compatibility level of a database, query the **compatibility_level** column in the [sys.databases](../../relational-databases/system-catalog-views/sys-databases-transact-sql.md) catalog view.
95+
96+
> [!NOTE]
97+
> In [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] RTM and Service Pack 1, the [distribution database](../../relational-databases/replication/distribution-database.md) has a compatibility level of 90, which is not supported for other databases. This does not have an impact on the functionality of replication. In later service packs and versions of SQL Server, the compatibility level of the distribution database is increased to match that of the **master** database.
9798
9899
## Using Compatibility Level for Backward Compatibility
99100
Compatibility level affects behaviors only for the specified database, not for the entire server. Compatibility level provides only partial backward compatibility with earlier versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Starting with compatibility mode 130, any new query plan affecting features have been added only to the new compatibility mode. This has been done in order to minimize the risk during upgrades that arise from performance degradation due to query plan changes. From an application perspective, the goal is still to be at the latest compatibility level in order to inherit some of the new features as well as performance improvements done in the Query optimizer space but to do so in a controlled way. Use compatibility level as an interim migration aid to work around version differences in the behaviors that are controlled by the relevant compatibility-level setting. For more details see the Upgrade best practices later in the article.

0 commit comments

Comments
 (0)