使用SQL Server Server Management Studio导入/导出数据库 [英] Import / Export database with SQL Server Server Management Studio

查看:187
本文介绍了使用SQL Server Server Management Studio导入/导出数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是微不足道的,但它不是...我相信有一个简单的方法来做,但我无法找到它。我想要导入/导出数据库本身,表,约束(外键等等),对我而言羞耻。



我不想得到它的数据,但如果没有其他方法,我可以摆脱它。



所以...如何导出数据库使用MS SQL Server Management Studio?您如何导入?



我发现的唯一解决方案是右键单击表和脚本创建,但我有一些像100个表,所以我'



谢谢!

解决方案

右键点击数据库本身,任务 - >生成脚本...



然后按照向导。



对于SSMS2008 +,if您还要导出数据,在设置脚本选项步骤中,选择高级按钮,并将数据类型到脚本从仅限模式更改为仅数据或模式和数据。 / p>

I thought this would be trivial, but it isn't... I'm sure there is a simple way to do it but I can't manage to find it. Shame on me.

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.

So... how do you export a database using MS SQL Server Management Studio ? How do you import it?

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.

Thanks!

解决方案

Right click the database itself, Tasks -> Generate Scripts...

Then follow the wizard.

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导入/导出数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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