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


- 导入具有可变标题的 Excel 文件 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 更改自动增量起始编号? 2021-01-01