Exporting data In SQL Server as INSERT INTO(将 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??
推荐答案
在对象资源管理器的 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 Addin"包,它几乎承诺相同的功能和更多功能(如快速查找等)
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 SQL Server 中的数据导出为 INSERT INTO
基础教程推荐
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 无法解决整理冲突 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
