[Microsoft][ODBC SQL Server Driver][SQL Server]无法预定义语句。
解决办法如下: 【转自http://www.dbforums.com/sybase/1615658-powerdesigner-problem.html】
To recover from this bug, you have to change DBMS configuration. To change your DBMS config follow below steps;
1) Goto "tools/resources/DBMS"
2) select Microsoft SQL Server 2005 (or any derivative from it)
3) Click properties
4) Go to "Script/objects/column"
5) Click on SqlListQuery
7) Backup current SQL script in the value window.
6) change the SQL script in the value window with the following;
{OWNER, TABLE, S, COLUMN, DTTPCODE, LENGTH, SIZE, PREC, COMPUTE, NOTNULL, IDENTITY, DOMAIN, DEFAULT, ExtIdentitySeedInc, ExtCollation, ExtIdtNotForReplication, ExtDeftConstName, ExtRowGuidCol}
select
u.name,
o.name,
c.column_id,
c.name,
t.name,
c.precision,
case when c.system_type_id in (99, 231, 239) then (c.max_length/2) else c.max_length end,
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,
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,
convert(varchar(8000), d.definition),
case (c.is_identity) when 1 then convert(varchar, i.seed_value) + ', ' + convert(varchar, i.increment_value) else '' end,
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)
where
o.type in ('U', 'S', 'V')
[ and u.name = %.q:OWNER%]
[ and o.name=%.q:TABLE%]
order by 1, 2, 3