简体   繁体   English

SQL Server 2014备份到2012

[英]SQL Server 2014 backup to 2012

Are there any tools to convert SQL Server 2014 database to 2012? 是否有任何工具可以将SQL Server 2014数据库转换为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. 我尝试了生成脚本但生成的脚本数据太大而SQL Server Management Studio没有执行它,我需要同时拥有模式和数据。

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: 据我所知,在不使用第三方工具的情况下,将数据库迁移到较低版本的SQL Server基本上两个选项:

  • Generate Scripts (not really suitable for large amounts of data) 生成脚本(不太适合大量数据)
  • Custom Scripting and BCP or Import/Export Wizard 自定义脚本和BCP或导入/导出向导
  • SQL Server Integration Services (Transfer Database Task) SQL Server Integration Services(传输数据库任务)

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. 第三个选项使用SISS传输数据库任务 ,它基本上使用SMO在目标服务器上创建对象,然后传输数据。 This is the recommended way of migrating a database between SQL Server instances of different versions. 这是在不同版本的SQL Server实例之间迁移数据库的推荐方法。 SSIS requires that you have installed SQL Server Data Tools - Business Intelligence (SSDT-BI) for Visual Studio. SSIS要求您为Visual Studio安装了SQL Server数据工具 - 商业智能(SSDT-BI)。 Before SQL Server 2012, this was called Business Intelligence Development Studio (BIDS). 在SQL Server 2012之前,这称为商业智能开发工作室(BIDS)。 You can download these here: 你可以在这下载这些:

Use the script, but instead of executing it trough Management Studio, use the lightweight sqlcmd utility. 使用该脚本,但不是通过Management Studio执行它,而是使用轻量级sqlcmd实用程序。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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