创建 sql 图

发布于 2024-08-08 00:54:48 字数 184 浏览 2 评论 0原文

我安装了 SQL Server 2005,并且想要创建数据库,但无法创建。当我在 SQL Server Management Studio 2005 中右键单击数据库的“数据库图表”文件夹时,没有看到任何用于创建数据库图表的选项。我看到两件事:

  1. 使用 sql server 2000 图表
  2. 刷新

I installed SQL Server 2005, and I want to create a database but I can't. When I right click on the Database Diagrams folder for my database in SQL Server Management Studio 2005, I don't see any choice for creating database diagram. I see two things:

  1. Working With sql server 2000 Diagrams
  2. Refresh

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

吾家有女初长成 2024-08-15 00:54:48

SQL Server Management Studio 中的向导创建的 ERD 图是物理 ERD,而不是逻辑 ERD。这与使用 Oracle Designer 不同...

您需要首先创建表,并根据需要进行关联。一旦定义了至少一个表,就应该能够创建数据库图。

The ERD diagram created by the wizard in SQL Server Management Studio is a physical ERD, not a logical one. It's not like using Oracle Designer...

You need to create your table(s) first, and relate as necessary. Once you have at least one table defined, the ability to create a Database Diagram should appear.

甲如呢乙后呢 2024-08-15 00:54:48

我过去曾尝试过此操作,现在看到这篇文章后再次尝试。以下是我使用 SQL 2005 Management Studio(连接到 SQL Server 2005)的经验:

  1. 如果您创建一个空白数据库(无表)并单击“数据库图”,系统会提示您:
    “此数据库没有创建数据库图表所需的对象。您要创建它们吗?”

  2. 如果您回答“是”,您可以右键单击“数据库图”节点,然后单击“新建数据库图”。默认提示的标题是“添加表”。如果您已经有表格并想要添加到图表中,这非常有用。但是,它只提供“刷新”选项。虽然存在的添加按钮已被禁用(我们还没有表)。

  3. 现在要创建一个表,您可以关闭“添加表”对话框,然后右键单击右侧窗格,然后单击“新建表”

  4. 从这里开始,创建表的过程就很直观了。保存图表时,会在数据库中创建表。

I have tried this in the past and tried it again now after seeing this post. Here is my experience with SQL 2005 Management Studio (connected to SQL Server 2005):

  1. If you create a blank database (no tables) and click on "Database Diagrams" you are prompted with:
    "This database does not have the objects required to create database diagrams. Do you want to create them?"

  2. If you answer yes, you can right click on Database Diagrams node and click "New Database Diagram". The default prompt comes up with the title "Add Table". This is good if you already have tables and want to add to diagram. However, it only gives options to "Refresh". The add button though present is disabled (we do not have tables yet).

  3. Now to create a table, you can close the "Add Table" dialogue and right click in the right hand side pane and click "New Table"

  4. From hereon, the process of creating a table is intuitive. When you save the diagram, the table gets created in the database.

舞袖。长 2024-08-15 00:54:48

展开文件夹,它应该提示安装对象。然后您应该能够添加图表。

Expand folder, it should prompt to install objects. Then you should be able to add diagrams.

冰雪梦之恋 2024-08-15 00:54:48

首先,您应该通过编写脚本而不是使用 GUI 来创建表。

您描述的症状表明数据库是作为 SQL Server 2000 数据库创建的,因此您无法在 SSMS 2005 中使用图表创建器。如果您认为必须使用图表而不是脚本来执行此操作,那么您必须使用企业管理器。如果您单击了“1.使用 sql server 2000 图”选项,那么 SQl Server 会告诉您这一点。

In the first place, you shoud be creating tables by writing scripts not using the GUI.

The symptoms you describe indicate the database was created as a SQL Server 2000 database and thus you cannot use the diagram creator in SSMS for 2005. If you feel you must do this with a diagram instead of with a script, then you must use Enterprise Manager. If you had clicked on the 1.Working With sql server 2000 Diagrams choice, then SQl Server would have told you this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文