在SQL Server中将数据导出为INSERT INTO [英] Exporting data In SQL Server as INSERT INTO

查看:120
本文介绍了在SQL Server中将数据导出为INSERT INTO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server 2008 Management Studio,并具有要迁移到其他数据库服务器的表。

I am using SQL Server 2008 Management Studio and have a table I want to migrate to a different db server.

是否可以将数据导出为插入SQL脚本?

Is there any option to export the data as an insert into SQL script??

推荐答案

在Object Explorer的SSMS中,右键单击数据库,右键单击并选择任务,然后选择生成。脚本。

In SSMS in the Object Explorer, right click on the database, right-click and pick "Tasks" and then "Generate Scripts".

这将允许您为单个或所有表生成脚本,其中一个选项是脚本数据。如果将其设置为TRUE,向导将为您的数据生成一个带有INSERT INTO()语句的脚本。

This will allow you to generate scripts for a single or all tables, and one of the options is "Script Data". If you set that to TRUE, the wizard will generate a script with INSERT INTO () statement for your data.

如果使用2008 R2或2012,则称为其他名称,请参见下面的屏幕截图

选择脚本的数据类型,可以是仅数据,模式和数据或仅模式-默认值)。

Select "Types of Data to Script" which can be "Data Only", "Schema and Data" or "Schema Only" - the default).

然后在Codeplex上有一个 SSMS插件包(包括源),它承诺几乎具有相同的功能以及更多功能(例如快速查找等)。

And then there's a "SSMS Addin" Package on Codeplex (including source) which promises pretty much the same functionality and a few more (like quick find etc.)

这篇关于在SQL Server中将数据导出为INSERT INTO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆