title | ms.custom | ms.date | ms.prod | ms.prod_service | ms.reviewer | ms.technology | ms.topic | helpviewer_keywords | ms.assetid | author | ms.author | monikerRange | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
View or Change the Compatibility Level of a Database | Microsoft Docs |
11/24/2017 |
sql |
database-engine, sql-database |
supportability |
conceptual |
|
579867ec-57cb-4cb8-af35-9688c1e9e15d |
stevestein |
sstein |
=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDEappliesto-ss-asdb-xxxx-xxx-md] This topic describes how to view or change the compatibility level of a database in [!INCLUDEssCurrent] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql]. Before you change the compatibility level of a database, you should understand the impact of the change on your applications. For more information, see ALTER DATABASE Compatibility Level (Transact-SQL).
In This Topic
-
Before you begin:
-
To view or change the compatibility level of a database, using:
Requires ALTER permission on the database.
-
After connecting to the appropriate instance of the [!INCLUDEssDEnoversion], in Object Explorer, click the server name.
-
Expand Databases, and, depending on the database, either select a user database or expand System Databases and select a system database.
-
Right-click the database, and then click Properties.
The Database Properties dialog box opens.
-
In the Select a page pane, click Options.
The current compatibility level is displayed in the Compatibility level list box.
-
To change the compatibility level, select a different option from the list. The available options for different [!INCLUDEssde_md] versions are listed in the ALTER DATABASE Compatibility Level (Transact-SQL) page.
-
Connect to the [!INCLUDEssDE].
-
From the Standard bar, click New Query.
-
Copy and paste the following example into the query window and click Execute. This example returns the compatibility level of the [!INCLUDEssSampleDBobject] database.
USE AdventureWorks2012;
GO
SELECT compatibility_level
FROM sys.databases WHERE name = 'AdventureWorks2012';
GO
-
Connect to the [!INCLUDEssDE].
-
From the Standard bar, click New Query.
-
Copy and paste the following example into the query window and click Execute. This example changes the compatibility level of the [!INCLUDEssSampleDBobject] database to
120
, which is the compatibility level for [!INCLUDEssSQL14].
ALTER DATABASE AdventureWorks2012
SET COMPATIBILITY_LEVEL = 120;
GO