简体   繁体   中英

SQL Server 2014 backup to 2012

Are there any tools to convert SQL Server 2014 database to 2012?

I tried Generate Script but the generated script with data is too large and SQL Server Management Studio did not execute it, I need to have both schema and data.

To my knowledge, there are basically three two options for migrating a database to a lower version of SQL Server, without using 3rd party tools:

  • Generate Scripts (not really suitable for large amounts of data)
  • Custom Scripting and BCP or Import/Export Wizard
  • SQL Server Integration Services (Transfer Database Task)

First option is not suitable in your case, as noted.

Second option is to simply script the structure of the database, and then use the Import/Export Wizard to copy the data, one table at a time. Note, that if you have foreign key constraints in your database, you might want to disable the constraints until after you have populated all your tables with data. This blog post explains in details how this can be done.

Third option uses the SISS Transfer Database Task which basically uses SMO to create the objects on the destination server and then transfers the data. This is the recommended way of migrating a database between SQL Server instances of different versions. SSIS requires that you have installed SQL Server Data Tools - Business Intelligence (SSDT-BI) for Visual Studio. Before SQL Server 2012, this was called Business Intelligence Development Studio (BIDS). You can download these here:

Use the script, but instead of executing it trough Management Studio, use the lightweight sqlcmd utility.

http://msdn.microsoft.com/es-es/library/ms162773.aspx

哦,Dan的第二个选项不起作用:在为VS2013安装SSDT-BI并配置数据库传输任务后,它说源数据库实例的版本必须低于或等于目标数据库实例的版本:所以,从2014年到2012年(或在我的情况下是2008R2)的迁移是不可能的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM