13

I already have a database in SQL Server 2012 Enterprise edition.

It contains :

  • tables
  • views
  • procedures
  • objects

Now I want to downgrade the database to SQL Server 2008 Enterprise edition. I know there is no direct option. I tried to backup on 2012 and then restore on 2008. Not working.

Any Idea on how to completely transfer database ?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
DKG
  • 1,097
  • 2
  • 8
  • 14
  • 1
    Voted to move to dba.stack – Kermit Jan 29 '13 at 15:40
  • possible duplicate of [Create Database in SQL Server 2012, Script and Use in 2008?](http://stackoverflow.com/questions/10303791/create-database-in-sql-server-2012-script-and-use-in-2008) – Aaron Bertrand Jan 29 '13 at 16:52
  • See here as well: http://superuser.com/questions/468578/move-database-from-sql-server-2012-to-2008 – Shanerk Oct 02 '13 at 15:16
  • why not try SQL Server Data Tools http://msdn.microsoft.com/en-us/data/tools.aspx – Surya Pratap Jan 22 '14 at 07:11
  • Another answer [here uses BCP](http://dba.stackexchange.com/questions/15682/sql-server-2012-backward-compatibility-for-backups-with-2008/102858#102858) which I've found easier. – Chris May 30 '15 at 16:04
  • The answers confused me a bit when I had the same prob yesterday. I ended up using MS Management Studio and when you right-click on the db there, it's as easy as Task>Export data. It actually offered to import that same data and I was able to get it into 2008 simply with that function! :-) – MBaas Jun 05 '15 at 07:15

2 Answers2

12

You must export the database as text (.sql) and the import it back. See Run the SQL Server Import and Export Wizard. There are also 3rd party tools, like SQL Compare and SQL Data Compare.

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
  • +1 the only sensible way to go here – marc_s Jan 29 '13 at 15:44
  • First I exported the database by script but on destination, while inserting it shows some foreign key violation. How can I handle such issue? Show I follow a sequence to insert data? – DKG Jan 30 '13 at 10:13
  • You are going to fix each issue individually, depending on what the issue is. The sequence of operations is entirely dependent on your data and constraints, which obviously you do know while we do not. – Remus Rusanu Jan 30 '13 at 10:34
-1

Steps to migrate:

1) get the list of tables in which entry was made before in SQL Server 2012

2) Generate the scripts in SQL Server 2012 and in advance option select "data only" for export type

3) using python run the SQL statements with reference to list of step 1 insert values in SQL Server 2008

DKG
  • 1,097
  • 2
  • 8
  • 14