SQL Server: Attach incorrect version 661

0vvn1miw  于 2023-04-04  发布在  SQL Server
关注(0)|答案(3)|浏览(124)

When trying to attach a database file to:

Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64) Sep 16 2010 19:43:16 <X64> (Build 7600: )

I get this error message:

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

Any idea why? and how to solve it?

ccrfmcuu

ccrfmcuu1#

SQL Server 2008 databases are version 655. SQL Server 2008 R2 databases are 661. You are trying to attach an 2008 R2 database (v. 661) to an 2008 instance and this is not supported. Once the database has been upgraded to an 2008 R2 version, it cannot be downgraded. You'll have to either upgrade your 2008 SP2 instance to R2, or you have to copy out the data in that database into an 2008 database (eg using the data migration wizard, or something equivalent).

The message is misleading, to say the least, it says 662 because SQL Server 2008 SP2does support 662 as a database version, this is when 15000 partitions are enabled in the database, see Support for 15000 Partitions.docx . Enabling the support bumps the DB version to 662, disabling it moves it back to 655. But SQL Server 2008 SP2 does not support 661 (the R2 version).

0dxa2lsx

0dxa2lsx2#

To clarify, a database created under SQL Server 2008 R2 was being opened in an instance of SQL Server 2008 (the version prior to R2). The solution for me was to simply perform an upgrade installation of SQL Server 2008 R2. I can only speak for the Express edition, but it worked.

Oddly, though, the Web Platform Installer indicated that I had Express R2 installed. The better way to tell is to ask the database server itself:

SELECT @@VERSION
mum43rcc

mum43rcc3#

I found the proper solution for "The database cannot be opened because it is version 661. This server supports version 662 and earlier. A downgrade path is not supported." problem is that you have to change the name of server in your code to the correct one that you really used in your windows for example: in web.config file the name of server is Jam try to change it two Moh that right name of your server " as seen below

<add name="ConnectionString" connectionString="Data Source=.\Jam;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated S

相关问题