当前位置: 代码迷 >> PowerDesigner >> 生成powerdesigner生成sql,目录有错
  详细解决方案

生成powerdesigner生成sql,目录有错

热度:9938   发布时间:2013-02-26 00:00:00.0
生成powerdesigner生成sql,索引有错
我用powerdesigner生成出来的sql有一部分是:
create index Reference_2_FK
(
   MEM_PRO_ID
);  
这样自动生成sql,在执行时候有错,正确的写法应该是create index Reference_2_FK on T_MEMBER(MEM_PRO_ID) 
怎么在powerdesigner中设置让其生成正确的sql呢? 

大家帮帮忙,谢谢大家。
------解决方案--------------------------------------------------------
检查一下你创建的是不是你需要的数据库类型?
------解决方案--------------------------------------------------------
还没搞定呢?
我试了一下:
new PhysicalDataModel
选择sqlserver2000
创建了一个新表
建了一个字段
建了一个index
下面是proview的内容,你对照一下是不是你哪里错误了,我使用的pd11
if exists (select 1
            from  sysindexes
           where  id    = object_id('Table_1')
            and   name  = 'Index_1'
            and   indid > 0
            and   indid < 255)
   drop index Table_1.Index_1
go

if exists (select 1
            from  sysobjects
           where  id = object_id('Table_1')
            and   type = 'U')
   drop table Table_1
go

/*==============================================================*/
/* Table: Table_1                                               */
/*==============================================================*/
create table Table_1 (
   Column_1             char(10)             null
)
go

/*==============================================================*/
/* Index: Index_1                                               */
/*==============================================================*/
create   index Index_1 on Table_1 (

)
go

------解决方案--------------------------------------------------------
菜单=》database=》edit current dbms=》窗口=》script=》object=》index=》create

value中修改当前的为下面的然后保存,退出重新输出就应该可以了。
在修改前请将原有内容做个备份吧。


create [%UNIQUE%] [%CLUSTER%?clustered:[%R%?[nonclustered]]] index %INDEX% on [%TABLQUALIFIER%]%TABLE% (
%CIDXLIST%
)
[%OPTIONS%]
  相关解决方案