惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
博客园 - Franky
J
Java Code Geeks
V
Visual Studio Blog
G
Google Developers Blog
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
博客园 - 【当耐特】
IT之家
IT之家
I
InfoQ
U
Unit 42
C
Check Point Blog
Martin Fowler
Martin Fowler

博客园 - IT战神

[评论]为什么程序员的社会地位不高?--转载 获取相对路径 (c#) 数据库优化(转载) Linq to Entities实例 asp.net开源项目及学习资料 C#.net同步异步SOCKET通讯和多线程总结 winform的ftp方式上传 - IT战神 - 博客园 ms agent 精灵 带右键菜单c# c#面实题及答案 哲理人生 - IT战神 - 博客园 创业 史玉柱经典语录(转) jsp 面试题 regsvr32 注册大全 DotNet控件开发的资料列表(共享) ie6 和ie7版本带来的一个奇怪的中文乱码问题(长度为奇数时最后一个字符会出现乱码)(原创) uml 图解 jsp cookie 中文乱码 的解决方法 xtree,不错的javascript树
转载--解决PowerDesigner 反向工程没有列注释(SQLSERVER 2005...
IT战神 · 2012-02-06 · via 博客园 - IT战神

在PD的 Tools-->Resources-->DBMS-->SQL Server 2005打开DBMS属性窗口,在General选项卡中选择Microsoft SQL Server 2005-->Script-->Objects-->Column-->SQLlistquery修改其中的内容为:

{OWNER, TABLE, S, COLUMN, DTTPCODE, LENGTH, SIZE, PREC, COMPUTE, NOTNULL, IDENTITY, DOMAIN, DEFAULT, ExtIdentitySeedInc, COMMENT, ExtCollation, ExtIdtNotForReplication, ExtDeftConstName, ExtRowGuidCol}select
    u.name,
    o.name,
    c.column_id,
    c.name,
    
case when c.system_type_id in (165167231and c.max_length = -1 then t.name + '(Max)' else t.name end,
    c.
precision,
    
case (c.max_length) when -1 then 0 else case when c.system_type_id in (99231239then (c.max_length/2else (c.max_length) end end as colnA,
    c.scale,
    
case(c.is_computed) when 1 then convert(varchar(8000), (select z.definition from [%CATALOG%.]sys.computed_columns z where z.object_id = c.object_id and z.column_id = c.column_id)) else '' end as colnB,
    
case(c.is_nullable) when 1 then 'NULL' else 'NOTNULL' end,
    
case(c.is_identity) when 1 then 'identity' else '' end,
    
case when(c.user_type_id <> c.system_type_id) then (select d.name from [%CATALOG%.]sys.types d where d.user_type_id = c.user_type_id) else '' end as colnC,
    
convert(varchar(8000), d.definition),
    
case (c.is_identity) when 1 then convert(varchar, i.seed_value) + '' + convert(varchar, i.increment_value) else '' end as colnD,
    
convert(varchar(8000),e.value) as colnE,
    c.collation_name,
    
case (i.is_not_for_replication) when 1 then 'true' else 'false' end,
    d.name,
    
case(c.is_rowguidcol) when 1 then 'true' else 'false' end
from
    
[%CATALOG%.]sys.columns      c
    
join [%CATALOG%.]sys.objects o on (o.object_id = c.object_id)
    
join [%CATALOG%.]sys.schemas u on (u.schema_id = o.schema_id)
    
join [%CATALOG%.]sys.types   t on (t.user_type_id = c.system_type_id)
    
left outer join [%CATALOG%.]sys.identity_columns i on (i.object_id = c.object_id and i.column_id = c.column_id)
    
left outer join [%CATALOG%.]sys.default_constraints d on (d.object_id = c.default_object_id)
    
left outer join [%CATALOG%.]sys.extended_properties e on (e.class=u.schema_id and e.major_id=o.object_id and e.minor_id = c.column_id and e.name=N'MS_Description')
where 
   o.type 
in ('U''S''V')
[  and u.name = %.q:OWNER%]
[  and o.name=%.q:TABLE%]
order by 123

其实只是更改了

convert(varchar(8000),e.value) as colnE,

新加了

left outer join [%CATALOG%.]sys.extended_properties e on (e.class=u.schema_id and e.major_id=o.object_id and e.minor_id = c.column_id and e.name=N'MS_Description')