将数据导入 Server Management Studios 图表描述字段
假设我有一个很大的数据库,大约有 800 个表。在此数据库中,有一个表充当元表,描述数据库中其他表的所有字段,以用于文档目的。这个表是我工作的公司自己写的一个工具读取的。
我是公司的新人,经验比较不足,所以请原谅我问这个...
在SSMS 2008 R2中我想制作一个实体关系图,这似乎是可能的,这很棒。我还发现可以显示图中每个字段的描述,而无需先单击表/实体来显示描述。有没有办法自动将前面提到的“元表”的相关数据插入到图中相应表格形状的每个字段的描述/注释条目中?我可以手动完成,但我想在做任何愚蠢的事情(大量工作)之前我最好先在这里问一下。我考虑过 SQL 过程,但我想做的事情涉及图表编辑器本身的描述字段,所以我认为 Transact SQL 不涵盖这一点。
顺便说一句,如果有人知道如何设置/显示图表中关系的基数,请告诉我。
顺便说一句,我们(公司)也有 Visio 2007(并不是说它可以解决任何问题..),但我想首先使用 SSMS 2008 R2 设置外键(不存在),然后通过逆向工程选项将其导入 Visio。对我来说似乎更合乎逻辑,而不是在第一步中使用 Visio。当然,我正在使用数据库的备份。
Suppose I have a big database, about 800 tables. In this database there is a table that serves as a metatable describing all of the fields of the other tables in the database, for documentation purposes. This table is read by a self written tool of the company I work at.
I'm new at the company and I'm rather inexperienced, so please forgive me for asking this...
In SSMS 2008 R2 I want to make an entity relationship diagram, which seems possible, which is great. I also see that it is possible to show a description for each field in the diagram, without clicking on a table/entity first to show the descriptions. Is there any way to automatically insert the relavant data of the previous mentioned "metatable" into the description/note entry of each field of the corresponding table shapes in the diagram? I could do it manually but I thought I better ask here before I do anything stupid (lot of work). I thought about SQL Procedures, but the thing I am trying to do involves the description fields of the diagram editor itsself, so I don't think that is covered with Transact SQL.
BTW, if somebody knows how to set/show the cardinality of the relationships in the diagramm please tell me.
By the way, we (the company) have Visio 2007 too (not that it would solve any of the problems..), but I'd like to use SSMS 2008 R2 first to set foreign keys (which are not there) and then import that into Visio through the reverse engineering option. Seems more logical for me, instead of using Visio in the first step. Of course I'm using a backup of our database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
图描述不是图的属性,而是表本身的属性。
请参阅 SQL Server 在线书籍中的
sp_addextendedproperty
:您需要添加一个名为
'MS_Description'
的扩展属性。有关有用的扩展描述,请参见此处:
The diagram description is not a property of the diagram it is a property of the table itself.
See
sp_addextendedproperty
in SQL Server books online:You need to add an extended property with the name
'MS_Description'
.For a useful extended description, see here: