Each SQL Server version has a specific native compatibility level, as a way to distinguish it from other SQL Server versions. The compatibility level is used internally in SQL Server for many operations.
For example, if you try to restore a database backup taken on SQL Server 2017 with native compatibility level 140, to an older SQL Server instance, for example SQL Server 2014 with native compatibility level 120 you will get an error since you cannot do that.
However, if you backup a database on a SQL Server instance (i.e. instance A) and restore it on a newer one (i.e. instance B), given the fact that the instance B is backwards compatible with instance A, you can restore the database on the new instance and either maintain its compatibility level, or upgrade it (via database options) to the native compatibility level of the new SQL Server instance.
In the below table, you can find the currently available SQL Server versions, along with their compatibility level and backwards compatibility:
|SQL Server Version||Compatibility Level||Backward compatibility|
|2008||100||100, 90, 80|
|2008 R2||100||100, 90, 80|
|2012||110||110, 100, 90|
|2014||120||120, 110, 100|
|2016||130||130, 120, 110, 100|
|2017||140||140, 130, 120, 110, 100|
|2019||150||150, 140, 130, 120, 110, 100|
Moreover, there is a free online service I have created for SQLNetHub, which given a SQL Server version, it returns backwards compatibility info.
Also, you can learn more about SQL Server, by enrolling to my course “SQL Server Fundamentals (SQL Database for Beginners)“.
Last, you can learn more about SQL Server compatibility levels and the ALTER DATABASE T-SQL statement on this MS-Docs article.
Rate this article:
Reference: aartemiou.com (https://www.aartemiou.com)
© Artemakis Artemiou