| title | sp_dbcmptlevel (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 03/14/2017 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine | ||
| ms.component | system-stored-procedures | ||
| ms.reviewer | |||
| ms.suite | sql | ||
| ms.technology | system-objects | ||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | 508c686d-2bd4-41ba-8602-48ebca266659 | ||
| caps.latest.revision | 110 | ||
| author | edmacauley | ||
| ms.author | edmaca | ||
| manager | craigg |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]
Sets certain database behaviors to be compatible with the specified version of [!INCLUDEssNoVersion].
Important
[!INCLUDEssNoteDepFutureDontUse] Use ALTER DATABASE Compatibility Levelinstead.
Transact-SQL Syntax Conventions
sp_dbcmptlevel [ [ @dbname = ] name ]
[ , [ @new_cmptlevel = ] version ]
[ @dbname= ] name
Is the name of the database for which the compatibility level is to be changed. Database names must conform to the rules for identifiers. name is sysname, with a default of NULL.
[ @new_cmptlevel= ] version
Is the version of [!INCLUDEssNoVersion] with which the database is to be made compatible. version is tinyint, with a default of NULL. The value must be one of the following:
90 = [!INCLUDEssVersion2005]
100 = [!INCLUDEssKatmai]
110 = [!INCLUDEssSQL11]
120 = [!INCLUDEssSQL14]
130 = [!INCLUDEssSQL15]
0 (success) or 1 (failure)
If no parameters are specified or if the name parameter is not specified, sp_dbcmptlevel returns an error.
If name is specified without version, the [!INCLUDEssDE] returns a message displaying the current compatibility level of the specified database.
For a description of compatibilities levels, see ALTER DATABASE Compatibility Level (Transact-SQL).
Only the database owner, members of the sysadmin fixed server role, and the db_owner fixed database role (if you are changing the current database) can execute this procedure.
Database Engine Stored Procedures (Transact-SQL)
ALTER DATABASE (Transact-SQL)
Reserved Keywords (Transact-SQL)
System Stored Procedures (Transact-SQL)