SQL converter

ALTER DATABASE Compatibility Level

If there are issues with your database and it does not work properly in some of the SQL servers, you probably might look your syntax and check if it is compitable to the used server.

Database behaviors to be compatibility

The following function sets certain database behaviors to be compatible with the specified version of SQL Server.

Syntax:

ALTER DATABASE database\_name SET COMPATIBILITY\_LEVEL = { 90 | 100 | 110 }

Arguments:

database\_name
Is the name of the database to be modified.

COMPATIBILITY\_LEVEL { 90 | 100 | 110 }
Is the version of SQL Server with which the database is to be made compatible. The value must be one of the following:
90 = SQL Server 2005
100 = SQL Server 2008 and SQL Server 2008 R2
110 = SQL Server 2012

Examples:

The following example changes the compatibility level of the AdventureWorks2012 database to 110, SQL Server 2012.

ALTER DATABASE AdventureWorks2012 SET COMPATIBILITY\_LEVEL = 110;GO