Thursday, May 28, 2015

Compatibility Levels Supported by Different SQL Server Versions

Software is evolving and certainly SQL Server is not an exception to the rule. Every few years we need to upgrade our databases in order to run on a newer version of SQL Server and take advantage of significant new features that will enhance the operations of our organization.

However, upgrading a database to a newer compatibility level of any DBMS involves evaluating not just the database but also how an entire application supported by that database will behave.

The easiest thing for many people is to move the database to the new version of SQL Server but make use of the backwards compatibility support of the Database Engine. This is however not a recommended approach because this way you cannot utilize all the features provided by the Database Engine of that new version of SQL Server.

A recommended high-level practice for moving a database to a newer version of SQL Server is:

  • Analyze your database with SQL Server Upgrade Advisor (for each SQL Server version there is the corresponding version of the Upgrade Advisor) in order to find any incompatibilities (i.e. the usage of deprecated features, etc.).
  • Resolve any compatibility issues that might be reported by the tool.
  • Move the database to the desired version of SQL Server on a Test Environment.
  • Test your database and the supported application to check if everything works well (this step involves any business users they application might have too).
  • Resolve any issues that might be raised.
  • Only if you are sure that everything works well after the testing process and any issues have been resolved then you can proceed to the actual migration.
Of course, it goes without saying that you always need to take backups of your databases, not only during their operational cycle but also always before you are going to make changes to their configuration.
Now, you might encounter certain cases where you deal with a "legacy" application and it might be nearly impossible to upgrade its supporting database to a newer version but at the same time you want to move it to a newer version of SQL Server. In such cases you can make use of the backwards compatibility the Database Engine of SQL Server provides. However, each version of SQL Server supports up to a specific compatibility level. For example if you have a SQL Server 2000 database you cannot migrate it to a SQL Server 2012 or 2014 instance because there is not backwards compatibility support for such an old version of SQL Server. You can however migrate it to a SQL Server 2008 R2 instance.
Below you can find the supported compatibility modes for SQL Server versions 2008/R2, 2012 and 2014:

SQL Server 2008
80: SQL Server 2000
90: SQL Server 2005
100: SQL Server 2008

SQL Server 2008 R2
80: SQL Server 2000
90: SQL Server 2005
100: SQL Server 2008 (and 2008 R2 - it is the same compatibility level)

SQL Server 2012
90: SQL Server 2005
100: SQL Server 2008 and SQL Server 2008 R2
110: SQL Server 2012

SQL Server 2014
100: SQL Server 2008 and SQL Server 2008 R2
110: SQL Server 2012
120: SQL Server 2014

Artemakis Artemiou [MVP]

Author & Editor

Artemakis Artemiou is a Senior SQL Server Architect, Software Developer and Microsoft Data Platform MVP. He is also an author, regular blogger, president of Cyprus.NET User Group and CY Country leader of INETA-EU. He is also the creator of DBA Security Advisor and In-Memory OLTP Simulator. Artemakis is a frequent guest author of worldwide well-respected online journals where he writes articles focusing on many SQL Server topics.

Reference: The SQL Server and .NET Hub (http://www.sqlnethub.com)

0 comments: