简体   繁体   English

导出数据库中的所有对象(表,主键/外键等)。

[英]Exporting all objects in database (tables,primary / foreign keys, etc..)

I am running SQL Server 2008 R2 and I am having trouble exporting the relationships between the tables (ie foreign key/primary keys, indexes, etc..) 我正在运行SQL Server 2008 R2,但无法导出表之间的关系(即外键/主键,索引等)。

My goal is to export everything related to the database (expect for the data) and import it into an Entity relationship diagram (there are over 100 tables). 我的目标是导出与数据库有关的所有内容(期望数据)并将其导入到实体关系图中(有100多个表)。

If someone would provide the steps how to export I would be greatly appreciated 如果有人会提供如何导出的步骤,我将不胜感激

You want to script the database. 您要编写数据库脚本。

In SQL Server Management Studio, right click on the database. 在SQL Server Management Studio中,右键单击数据库。 Then choose Tasks-->Generate Scripts . 然后选择“ Tasks-->Generate Scripts This brings up the SQL Server Scripts Wizard. 这将打开SQL Server脚本向导。

You can probably take it from there. 您可能可以从那里拿走。 The wizard asks what scripts and what objects you want to create. 向导会询问您要创建哪些脚本和对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM