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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 雪叶丹枫

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才能将修改后的模板文件保存。