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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - 雪叶丹枫

Excel 2016 密码保护破解 记录一个Word操作技巧,很偏门的,鉴于Google很不方便用了,百度起来比较费劲所以记录一下 Powerdesigner 16.5 从SQL Server 2012做逆向工程时提示:Unable to list tables问题 人生的一次自我审视 Microsoft 2013 新技术学习笔记 四 Microsoft 2013 新技术学习笔记 三 Microsoft 2013 新技术学习笔记 二 Microsoft 2013 新技术学习笔记 一 关于餐厅的一个突然地想法 选择... 传统三单匹配的制造业采购付款流程风险和弊端分析 站在K2角度审视流程--任务的独占与释放 Android之旅 -- ROM定制 -- 美化 -- 默认屏的下方操作菜单 Android之旅 -- 刷机 -- 前言 企业流程 流程管理的售前意识 在非K2服务器上部署基于K2的Web Application 站在企业角度来审视K2 站在业务流程管理角度来审视K2
PowerDesigner 16.5对SQL Server 2012 生成数据库时"不支持扩展属性"问题
雪叶丹枫 · 2014-08-26 · via 博客园 - 雪叶丹枫

团队合作设计一套系统数据模型,创建了PDM后,Table、View、Store Procedure等都创建好了,且创建了多个Schema方便管理这些数据库对象,但Table、view、Column等对象有Comment时(用来在团队不同成员间共享描述信息)

生成数据库时会得到一个提示"不支持扩展属性,或对象不存在",分析发现异常在类似以下语句:

if exists(select 1 from sys.extended_properties p where
      p.major_id = object_id('Environment.Resource')
  and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ResourceCode')
)
begin
   execute sp_dropextendedproperty 'MS_Description',
   'user', 'Environment', 'table', 'Resource', 'column', 'ResourceCode'

end
execute sp_addextendedproperty 'MS_Description',
   '资源编码',
   'user', 'Environment', 'table', 'Resource', 'column', 'ResourceCode'
go

分析原因,发现是由于采用了Schema(上述代码中的Environment),所以sp_addextendedproperty存储过程的第三个参数就应该是SCHEMA而不是user。查询相关资料发现以上SQL语句是基于Powerdesigner自带的对应的.xdb文件生成的,如下图是Column注释信息的SQL代码模板,对应的xdb模板文件存放在powerdesigner安装路径的Sybase\PowerDesigner 16\Resource Files\DBMS\sqlsv2012.xdb

如上图,每个Column的Comment信息均通过以上代码模板生成,所以只需要修改代码模板(将sp_addextendedproperty的第三个参数值由user修改为schema即可)即可让所有对象的Comment生成语句得到修正。

注:在win7以上系统中需要使用管理员权限运行powerdesigner才能将修改后的模板文件保存。