Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2008 to SQL Server 2005

I have an MDF and LDF file of SQL Server 2005. i attached it with SQL Server 2008 and did some change in data. now when i attached it back to sql server 2005 Express Edition it gives version error.

The database 'E:\DB\JOBPERS.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported. Could not open new database 'E:\DB\JOBPERS.MDF'. CREATE DATABASE is aborted. An attempt to attach an auto-named database for file E:\DB\Jobpers.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

like image 521
Sakhawat Avatar asked May 19 '10 23:05

Sakhawat


People also ask

What is SQL Server 2005 backward compatibility?

Microsoft SQL Server 2005 Backward compatibility is a program developed by Microsoft. The most used version is 8.05. 2312, with over 98% of all installations currently using this version. It adds a background controller service that is set to automatically run.

Can we directly upgrade SQL Server 2008 to 2016?

SQL Server 2016 supports upgrade from the following versions of SQL Server: SQL Server 2008 SP4 or later. SQL Server 2008 R2 SP3 or later.


5 Answers

I know what the problem is, it is quit descriptive error. but was asking the solution of that problem. anyway thanks to everyone for there reply.

anyone facing same problem, see the tread below and read LEKSS reply http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/46ce6099-61c6-4526-9dda-10a3359386cb

hope this will help


Update: Quoted external link for safe keeping

The database 'ASPNETDB.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier.

You cannot backup/restore or detach/attach from a higher version to a lower version.

  1. Use database publishing wizard to get out the script for all objects in 2008 db

http://www.microsoft.com/downloads/details.aspx?FamilyId=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
http://blogs.msdn.com/webdevtools/archive/2007/10/15/sql-database-publishing-wizard-is-now-in-visual-studio-orcas.aspx
http://msdn.microsoft.com/en-us/library/bb895179.aspx

  1. Create a new empty database in your 2005 instance .
  2. Execute the above generated script in your new 2005 database.
  3. Move your SQL server logins/users from 2008 database to 2005 database using sp_help_revlogin stored procedure.

Thanks, Leks

Proposed As Answer byyup. _ Sunday, May 09, 2010 10:14 AM
Marked As Answer byTom Li - MSFTMicrosoft, ModeratorThursday, May 20, 2010 4:58 AM

like image 136
Sakhawat Avatar answered Nov 09 '22 23:11

Sakhawat


Your MDF and LDF are now version 655 (the SQL 2008 version). As the error message clearly states, there is no downgrade possibility. From now on, you can only attach these files to SQL Server 2008 or to SQL Server 2008 R2 (which will upgrade them to 661 btw). You can never attach these files back to a SQL 2005 instance.

like image 45
Remus Rusanu Avatar answered Nov 10 '22 00:11

Remus Rusanu


I know this was answered but this one solved the problem for me:

database-cannot-be-opened-because-it-is-version-655

basically remove "\SQLEXPRESS" from connection string value. instead of: Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\OTJDB.mdf;Integrated Security=True;User Instance=True

use: Data Source=.;AttachDbFilename=|DataDirectory|\OTJDB.mdf;Integrated Security=True;User Instance=True

like image 31
cinek Avatar answered Nov 10 '22 01:11

cinek


It's because the file formats are fundamentally different. If you attach the file to SQL server 2008, you MUST upgrade your express edition to at leas. The version you last attached the file to.

So you only have 2 choices: upgrade or ditch your file and redo your updates on a 2005 install.

like image 27
Dave Markle Avatar answered Nov 10 '22 00:11

Dave Markle


It is a one way street, you can always go up aversion but never down a version, this is because of meta data changes

like image 22
SQLMenace Avatar answered Nov 10 '22 01:11

SQLMenace