Is there a way to restore a SQL Server 2012 database backup to a SQL Server 2008?
I tried to attach file, it does not work.
migrated from stackoverflow.com Jul 9 '12 at 17:00
This question came from our site for professional and enthusiast programmers.
No, you cannot go backward, only forward. You can create an empty database on 2008 and then use the Generate Scripts wizard in Management Studio to script the schema and data (or 3rd party comparison tools from Red Gate and others). Make sure you set the right target version as 2008, and you'll have to flesh out incompatible things (e.g. OFFSET or FORMAT) that you might have used in 2012.
You have couple of options :
Option A : Script out database in compatibility mode using Generate script option :
Note : If you script out database with schema and data, depending on your data size, the script will be massive and wont be handled by SSMS, sqlcmd or osql (might be in GB as well).
First script out tables first with all Indexes, FK's, etc and create blank tables in the destination database - option with SCHEMA ONLY (No data).
Use BCP to insert data
This is very fast bcp method as it uses Native mode.
There is no supported way to do this because SQL Server doesn’t allow this kind of compatibility.
What you can do is to
If you don’t have SQL Server 2012 then you can use third party tools to read backup and extract data and structure.
In this case just create empty database on SQL 2008 and use tools such as ApexSQL Diff and ApexSQL Data Diff to synchronize objects and data. You can find these from other major vendors too such as Red-Gate or Idera.
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?