SQL Server Database Version Numbers

A database created by a more recent version of SQL Server cannot be attached or restored to an earlier version of SQL server. This restriction is simply because an older version cannot know about file format changes that were introduced in the newer release.

If you attempt to attach a database to an earlier version, you will get SQL Server ERROR 948 with the internal version numbers listed in the error message text.

For example, the following error occurs if you try to attach a SQL Server 2008 R2 database to a SQL Server 2008 server:

The database 'MyTest' cannot be opened because it is version 665. This server supports version 661 and earlier. A downgrade path is not supported.

Sample text from SQL Server error 948
The cryptic version numbers in the error message refer to the internal database version. These internal version numbers are undocumented but are (at least currently) the same value reported by the DATABASEPROPERTYEX function 'Version' property of the source database.

The table below maps the internal version numbers to SQL Server versions so you can determine the minimum version you need for the attach to succeed:

SQL Server Version Internal Database Version Database compatibility Level
SQL Server 2014 782 120
SQL Server 2012 706 110
SQL Server 2008 R2 660 / 661 100
SQL Server 2008 655 100
SQL Server 2005 SP2+ with VarDecimal enabled 612 90
SQL Server 2005 611 90
SQL Server 2000 539 80
SQL Server 7.0 515 70
SQL Server 6.5 * 65
SQL Server 6.0 * 60

No comments:

Post a Comment