powerdesigner V11;MsSqlServer7.0,2000逆向默认值名称不过来BUG
2008-10-20 18:05
148 查看
修改方法如下:
Tools >> Resources >> DBMS >> Mircosoft SQL Server7.X/Mircosoft SQL Server 2000
修改属性:Script >> Objects >> Columns >>
Create:
alter table [%QUALIFIER%]%TABLE%
add %COLUMN% [%COMPUTE%?AS (%COMPUTE%):%DATATYPE%[.Z:[%IDENTITY%? %IDENTITY%[[(%ExtIdentitySeedInc%)][%ExtIdtNotForReplication%? not for replication]]:[%ExtNullConstName%? constraint %ExtNullConstName%][ %NULL%][ %NOTNULL%]][[%ExtDeftConstName%? constraint %ExtDeftConstName%] default %DEFAULT%]]
[%CONSTDEFN%]]
SqlListQuery:
{OWNER, TABLE, S, COLUMN, DTTPCODE, LENGTH, SIZE, PREC, COMPUTE, NOTNULL, IDENTITY, DOMAIN, DEFAULT, ExtIdentitySeedInc, ExtIdtNotForReplication, ExtDeftConstName}
select
u.name,
o.name,
c.colid,
c.name,
case when (s.usertype < 100) then s.name else x.name end,
c.prec,
c.length,
c.scale,
z.text,
case (c.status & 8) when 8 then 'NULL' else 'NOTNULL' end,
case (c.status & 128) when 128 then 'identity' else '' end,
case when (s.usertype < 100) then '' else s.name end,
case (v.text) when '('''')' then '~''''~' else v.text end,
case (c.status & 128) when 128 then
convert(varchar(10), ident_seed(u.name + '.' + o.name))
+ ', '
+ convert(varchar(10), ident_incr(u.name + '.' + o.name))
else '' end as coln,
case (c.colstat & 9) when 9 then 'true' else 'false' end,
d.name
from
dbo.sysusers u
join dbo.sysobjects o on (o.uid = u.uid and o.type in ('U', 'S', 'V'))
join dbo.syscolumns c on (c.id = o.id)
left outer join dbo.systypes s on (c.usertype = s.usertype and s.xtype = c.xtype and c.usertype >= 0)
left outer join dbo.systypes x on (s.usertype > 100 and s.xtype = x.xtype and x.usertype not in (0, 18, 80) and x.usertype < 100)
left outer join dbo.syscomments z on (z.id = o.id and z.number = c.colid)
left outer join dbo.sysobjects d on (d.id = c.cdefault and d.category <> 0)
left outer join dbo.syscomments v on (v.id = d.id)
where 1 = 1
[ and u.name = %.q:OWNER%]
[ and o.name=%.q:TABLE%]
order by 1, 2, 3
Tools >> Resources >> DBMS >> Mircosoft SQL Server7.X/Mircosoft SQL Server 2000
修改属性:Script >> Objects >> Columns >>
Create:
alter table [%QUALIFIER%]%TABLE%
add %COLUMN% [%COMPUTE%?AS (%COMPUTE%):%DATATYPE%[.Z:[%IDENTITY%? %IDENTITY%[[(%ExtIdentitySeedInc%)][%ExtIdtNotForReplication%? not for replication]]:[%ExtNullConstName%? constraint %ExtNullConstName%][ %NULL%][ %NOTNULL%]][[%ExtDeftConstName%? constraint %ExtDeftConstName%] default %DEFAULT%]]
[%CONSTDEFN%]]
SqlListQuery:
{OWNER, TABLE, S, COLUMN, DTTPCODE, LENGTH, SIZE, PREC, COMPUTE, NOTNULL, IDENTITY, DOMAIN, DEFAULT, ExtIdentitySeedInc, ExtIdtNotForReplication, ExtDeftConstName}
select
u.name,
o.name,
c.colid,
c.name,
case when (s.usertype < 100) then s.name else x.name end,
c.prec,
c.length,
c.scale,
z.text,
case (c.status & 8) when 8 then 'NULL' else 'NOTNULL' end,
case (c.status & 128) when 128 then 'identity' else '' end,
case when (s.usertype < 100) then '' else s.name end,
case (v.text) when '('''')' then '~''''~' else v.text end,
case (c.status & 128) when 128 then
convert(varchar(10), ident_seed(u.name + '.' + o.name))
+ ', '
+ convert(varchar(10), ident_incr(u.name + '.' + o.name))
else '' end as coln,
case (c.colstat & 9) when 9 then 'true' else 'false' end,
d.name
from
dbo.sysusers u
join dbo.sysobjects o on (o.uid = u.uid and o.type in ('U', 'S', 'V'))
join dbo.syscolumns c on (c.id = o.id)
left outer join dbo.systypes s on (c.usertype = s.usertype and s.xtype = c.xtype and c.usertype >= 0)
left outer join dbo.systypes x on (s.usertype > 100 and s.xtype = x.xtype and x.usertype not in (0, 18, 80) and x.usertype < 100)
left outer join dbo.syscomments z on (z.id = o.id and z.number = c.colid)
left outer join dbo.sysobjects d on (d.id = c.cdefault and d.category <> 0)
left outer join dbo.syscomments v on (v.id = d.id)
where 1 = 1
[ and u.name = %.q:OWNER%]
[ and o.name=%.q:TABLE%]
order by 1, 2, 3
相关文章推荐
- Setup Factory 7.0获取安装包名称、读取.ini文件名、注册ActiveX组件、创建快捷方式、HTTP请求
- 修改相册类别名称的BUG
- SQL SERVER 2008 R2安装的时候提示“该实例名称MSSQLSERVER已在使用
- Entity Framework的默认值BUG解决方法
- Android 7.0 pendingIntent bug(AlarmManager通过PendingIntent传递数据(跨进程数据传递
- 关于ASP前端页面中“上下文找不到名称xxx"的解决办法(vs的bug?)
- 修改服务器名称为本机IP后登陆不上数据库~MSSQLSERVER服务不能启动的问题
- Action名称的搜索顺序及配置的各项默认值
- 动态传入“表名,字段名,字段类型,默认值”四个字符串,根据新的字段名称和类型来创表表结构
- android 7.0 PopWinow BUG
- android 7.0 PopupWindow bug修复,测试没啥问题
- unity HideInInspector 默认值 坑 记录 bug
- Android 7.0系统 PopupWindow的bug
- 数据表默认值约束名称为随机名称的问题
- 如何知道SQL中默认值约束名称是什么
- VS2010中项目名称尽量不要使用中文了! 有一个小bug
- [bug]使用SharpZipLib遇到中文名称乱码问题
- [C#][MVC]DropDownListFor 默认值无法选中的 BUG
- Entity Framework的默认值BUG解决方法
- Effective C++ Item 33 避免遮掩继承过来的名称