总是不能建立数所据库,新手用powerdesigner,问题出在什么地方,帮看看

解决方案 »

  1.   

    我怎么找不到这个资源?看看是不是这两个原因:
    1、没有建立链接到数据库的odbc驱动
    2、你生成的是脚本而不是数据库
      

  2.   

    连了数据库,感觉生的脚本有点问题,就是顺序,我贴出来大家看看我的文件地址,
    http://rovedog.free.huowww.net.cn/pd12.rarhttp://rovedog.free.huowww.net.cn/pd12.rar/*==============================================================*/
    /* DBMS name:      Microsoft SQL Server 2005                    */
    /* Created on:     2008-11-2 0:00:47                            */
    /*==============================================================*/
    alter table Edu8.score
       drop constraint FK_SCORE_SCOR2STUD_STUDENT
    goif exists (select 1
                from  sysindexes
               where  id    = object_id('Edu8.score')
                and   name  = 'scor2student_FK'
                and   indid > 0
                and   indid < 255)
       drop index Edu8.score.scor2student_FK
    goexecute sp_revokedbaccess Edu8
    go/*==============================================================*/
    /* User: Edu8                                                   */
    /*==============================================================*/
    execute sp_grantdbaccess Edu8
    go/*==============================================================*/
    /* Table: score                                                 */
    /*==============================================================*/
    create table Edu8.score (
       ID                   int                  not null,
       stuRID               int                  null,
       schID                varchar(50)          not null,
       name                 varchar(50)          null,
       sum                  int                  null,
       chinese              int                  null,
       constraint PK_SCORE primary key nonclustered (ID)
    )
    goexecute sp_addextendedproperty 'MS_Description', 
       '学生在表student中的dataID',
       'user', 'Edu8', 'table', 'score', 'column', 'stuRID'
    goexecute sp_addextendedproperty 'MS_Description', 
       '学号',
       'user', 'Edu8', 'table', 'score', 'column', 'schID'
    goexecute sp_addextendedproperty 'MS_Description', 
       '姓名',
       'user', 'Edu8', 'table', 'score', 'column', 'name'
    go/*==============================================================*/
    /* Index: scor2student_FK                                       */
    /*==============================================================*/
    create index scor2student_FK on Edu8.score (
    stuRID ASC
    )
    go/*==============================================================*/
    /* Table: student                                               */
    /*==============================================================*/
    create table Edu8.student (
       ID                   int                  not null,
       schID                varchar(50)          null,
       name                 varchar(50)          null,
       sex                  varchar(50)          null,
       type                 varchar(50)          null,
       constraint PK_STUDENT primary key nonclustered (ID)
    )
    goexecute sp_addextendedproperty 'MS_Description', 
       '校编学号8位',
       'user', 'Edu8', 'table', 'student', 'column', 'schID'
    goexecute sp_addextendedproperty 'MS_Description', 
       '学生录取类别',
       'user', 'Edu8', 'table', 'student', 'column', 'type'
    goalter table Edu8.score
       add constraint FK_SCORE_SCOR2STUD_STUDENT foreign key (stuRID)
          references Edu8.student (ID)
    go有点奇怪,怎么开始就是alert,表都还没有建呢
      

  3.   

    因为PD可以用覆盖的方式生成数据库,这样的话就需要对原来的数据库进行修改,所以会先有alter语句,但是新生成数据库的话,是没有什么影响的