powerdesigner: 生成的sql带有注解

默认情况下,PowerDesigner生成的SQL不包含字段注释,这在理解表结构时带来不便。通过Tools->Execute commands->Edit/run script执行特定脚本可为SQL添加注释。但这种方式可能会影响主键自增,特别是当使用Database->General->Script->Objects->Column->ColumnComment修改值时。解决方法是在创建表时直接为字段添加注释,避免对主键自增属性的影响。详情参考:https://blog.csdn.net/qq_28986619/article/details/79770411
摘要由CSDN通过智能技术生成

在默认的情况下,powerdesigner生成的表的sql语句是不带注释的。如果我们不懂表中的字段,那么我们可以在powerdesigner中查找。但是,这样是很麻烦的。你不想多次打开一个早就不需要使用的软件了吧。如果你电脑配置低,好呀,更麻烦了。怎么解决这一个问题?那就是给生成的sql加上注解。这样在查看数据库的时候,就可以查找字段的意思了。这样岂不是方便了很多。怎么操作?

tools->Excecute commands ->Edit/run script 执行如下代码即可:

'******************************************************************************
 
'* File: name2comment.vbs
 
'* Purpose: Database generation cannot use object names anymore
 
' in version 7 and above.
 
' It always uses the object codes.
 
'
 
' In case the object codes are not aligned with your
 
' object names in your model, this script will copy
 
' the object Name onto the object Comment for
 
' the Tables and Columns.
 
'
 
'* Title:
 
'* Version: 1.0
 
'* Company: Sybase Inc.
 
'******************************************************************************
 
Option Explicit
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值