PowerDesigner生成MS SQL foreign的问题
conis 2009-05-11 07:14:03 简单地说,就是从CDM生成PDM的时候,releationship约束无效,不能生成外键约束的代码。生成基于oracle的pdm没问题,ms sql server有问题。
当从CDM转到PDM(MS SQL Server)的时候,在CDM中的ReleationShip不能在CDM的foreign生成有效代码,References的Privew标签显示内容为:
-- The preview is empty because of the setting.
-- Check the generation option.
查看integrity标签,implementation显示为trigger,update/delete constraint分别为restrict,改变为update/delete constraint为none,并且改implementation为declarative后,preview中代码显示正常,如下:
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('meb_FriendRequest') and o.name = 'FK_MEB_FRIE_RS_MEMBER_MEB_MEMB')
alter table meb_FriendRequest
drop constraint FK_MEB_FRIE_RS_MEMBER_MEB_MEMB
go
alter table meb_FriendRequest
add constraint FK_MEB_FRIE_RS_MEMBER_MEB_MEMB foreign key (Member_ID)
references meb_Member (Member_ID)
go
根据提示,在创建pdm的时候查看选项,发现for sql server与for oracle内容不一样。
请问高手如何解决?