views:

903

answers:

2

I'm trying to attach my database on a server that is running SQL2005 and I encountered an error that says that my DB is version 655 which is not suppoerted on a 612 system. Is there a way to alter my DB to get to a attach or to find out what is causing the structural change that is preventing me from attaching my DB?

SOLUTION

If you right click on the database that you want to upgrade and go to generate scripts. You can then generate a copy of your database for the target version and find out form the error list which tables have problems and what those problems are. After you have altered your DB you can then use the script on the target machine. Don’t forget to select to add your indexes and data to the script.

I don’t know why no one has written this anywhere but for those out there suffering I’d recommend this as your first option. It worked great for me.

+2  A: 

This sounds to me like a version check in SQL server to make sure you don't use a new DB file with an old (unpatched) DB and corrupt it in the process.

2 Options:

1) Patch you database (bring it up to the latest patch level)

2) Attach your DB on a DB with the required patch level, export/backup it, move the backup to the offending server and import/restore it again.

markus_b
As stated, the simplest fix is to just install the latest sql server service packs. I'm pretty much of the opinion that in todays nefarious world, it's a crime to not keep up with them.
Chris Lively
A: 

If you right click on the database that you want to upgrade and go to generate scripts. You can then generate a copy of your database for the target version and find out form the error list which tables have problems and what those problems are. After you have altered your DB you can then use the script on the target machine. Don’t forget to select to add your indexes and data to the script.

I don’t know why no one has written this anywhere but for those out there suffering I’d recommend this as your first option. It worked great for me.

Middletone
Did you experience any loss of information concerning primary/foreign key relationships, schemas etc? I imported my v.655 DB file into SQL Server 2005 using the built-in import/export tool in SQL Management Studio Express. This, however resulted in a bunch of tables filled with data, but no relationship/constraint information whatsoever
The method above kept my keys and such. as for foreign key relationships I'm not sure. Redgate makes a handy tool that you can use to compare DB's and it can do a really bang on job of helping you migrate data/schema information from one DB to another. Its callled SQL compare.
Middletone