Setting Database Compatibility Level for SQL Server 2012
Using graphical interface in SSMS
The first method we are going to learn is from SQL Server Management Studio. Connect to the target SQL Server, inside SSMS, expand the SQL Server in Object Explorer and expand the databases node. Right click on the Database for which you would like to change / set the compatibility level
Using T-SQL the same task can be achieved by running ALTER database command and Set the Compatibility_level property to 110 as shown in the below script. Remember to change the database name with your database name.
ALTER DATABASE LearnSQLWithBru SET COMPATIBILITY_LEVEL = 110 GO
Once you have set the compatibility level, you can check if the changes have been applied by running the below script. Alternately you can check this by looking at the database properties (from object explorer).
SELECT NAME, COMPATIBILITY_LEVEL FROM SYS.DATABASES WHERE NAME = 'LearnSQLWithBru'