Import / Export database with SQL Server Server Management Studio(使用 SQL Server Server Management Studio 导入/导出数据库)
问题描述
我认为这很简单,但事实并非如此...我确定有一种简单的方法可以做到,但我无法找到它.为我感到羞耻.
我想导入/导出数据库本身、表、约束(外键等).我宁愿不拿数据,但如果没有其他办法,我可以摆脱它.
I want to import/export the database itself, the tables, the constraints (foreign keys and so on). I'd rather not get the data with it, but I can get rid of it after if there's no other way.
那么……您如何使用 MS SQL Server Management Studio 导出数据库?你如何导入它?
So... how do you export a database using MS SQL Server Management Studio ? How do you import it?
我找到的唯一解决方案是右键单击表格并创建脚本",但我有大约 100 个表格,所以我宁愿避免这种情况.
The only solution I found was right click on the tables and "script to Create", but I have something like 100 tables, so I'd rather avoid this.
谢谢!
推荐答案
右键单击数据库本身,Tasks -> Generate Scripts...
Right click the database itself, Tasks -> Generate Scripts...
然后按照向导操作.
对于 SSMS2008+,如果您还想导出数据,请在设置脚本选项"步骤中,选择高级"按钮并将脚本的数据类型"从仅架构"更改为仅数据"或架构和数据".
For SSMS2008+, if you want to also export the data, on the "Set Scripting Options" step, select the "Advanced" button and change "Types of data to script" from "Schema Only" to "Data Only" or "Schema and Data".
这篇关于使用 SQL Server Server Management Studio 导入/导出数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 SQL Server Server Management Studio 导入/导出数据库
基础教程推荐
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 无法解决整理冲突 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
