January 6, 2019
How to Change SQL Server Compatibility level
Changing Database compatibility level will be required when you upgrade your database from one version to another and you want to use the latest feature for sql version. For details on compatibility check this earlier post.
For example lets say when you upgrade a database from sql server 2012 to 2014 the compatibility level will be still on 110 .
To change it to the compatibility of SQL 2014 level of 120 below query can be used.
— SQL Server 2014
ALTER DATABASE [WideWorldImporters] SET COMPATIBILITY_LEVEL = 120
GO
For getting the compatibility level for different version please check this post.
Few notes to remember when changing the compatibility of SQL Server.
- You can perform testing in Development environment for checking any errors for compatibility changes or any performance issues.
- Once the compatibility level is change this change will immediately impact any future running queries.
- User can revert back the compatibility level in case if there are any errors.
- There is no restart of the server required when changing the compatibility level.
- Database compatibility will be always backward with earlier version of SQL server.
Check this post.
4,236 total views, 2 views today