简体   繁体   English

从SQL生成表

[英]Generating Tables from SQL

I'm using MS Access 2013 and I have started learning SQL. 我正在使用MS Access 2013,并且已经开始学习SQL。 I have written my SQL Database (all it does is make a bunch of tables) and I don't want to actually write anything in Access, I just want to bring in my SQL and request the Relationship Tables Diagram because my professor wants this particular diagram. 我已经写了我的SQL数据库(它所做的就是创建一堆表),并且我实际上不想在Access中写任何东西,我只想引入我的SQL并请求“关系表图”,因为我的教授想要这个特殊的表图。 Can someone tell me how to accomplish this? 有人可以告诉我如何做到这一点吗? When I try to bring in my SQL it gives me errors saying that it was expecting INSERTS, DELETES, etc. but I don't have any actual data yet. 当我尝试引入SQL时,出现错误,提示我期望插入,删除等,但还没有任何实际数据。 I tried to look it up, but everything on Access and SQL is about making queries and I don't think that is what I'm after. 我试图查找它,但是Access和SQL上的所有内容都是关于进行查询的,我不认为这是我追求的。

Your database schema should have the following. 您的数据库架构应具有以下内容。

1 - one create database statement
2 - one to x create tables statements
3 - primary keys for the each table
4 - foreign keys to express relationships.
5 - other object when business requirements need them.

http://en.wikipedia.org/wiki/Database_schema http://en.wikipedia.org/wiki/Database_schema

Given this schema, the TSQL file can be loaded into any good modeling tool like ERWIN to generate a diagram. 在这种模式下,可以将TSQL文件加载到任何良好的建模工具(如ERWIN)中以生成图表。

If you want to do it from MS Access, you can. 如果要通过MS Access进行操作,则可以。 Behind the scenes, MS Access does support SQL in the query builder and you can use the table diagram window. 在后台,MS Access在查询生成器中确实支持SQL,您可以使用表格图窗口。

On the other hand, you can link MS Access to a SQL database (all tables) and still use the table diagram window. 另一方面,您可以将MS Access链接到SQL数据库(所有表),并且仍使用表图窗口。

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

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