Home > database >  Powerdesigner modeling to export SQL script running failure
Powerdesigner modeling to export SQL script running failure

Time:11-19

Below is SQL script source code, can't run, get a 2 days really don't know exactly what's wrong with,,,


The alter table student
The drop foreign key FK_STUDENT_RELATIONS_SCHOOL;


The alter table student
The drop foreign key FK_STUDENT_RELATIONS_SCHOOL;

Drop table if the exists student;

Drop table if the exists school;

/*==============================================================*/
/* Table: student */
/*==============================================================*/
The create table student
(
StudentID char (1) not null comment ',
SchoolID char (1) not null comment ',
The Name char (10) the comment ',
Primary key (StudentID)
);

/*==============================================================*/
/* Table: school */
/*==============================================================*/
The create table school
(
SchoolID char (1) not null comment ',
SchoolName varchar (12) the comment ',
Primary key (SchoolID)
);

The alter table student add constraint FK_STUDENT_RELATIONS_SCHOOL foreign key (SchoolID)
The references school (SchoolID) on delete restrict on the update restrict;

CodePudding user response:

Powerdesigner modeling don't build a relationship when exporting to the script runs no problem, a building relationships is a problem,

CodePudding user response:

I also met the problem now, and I know where is wrong,

This generates SQL, alter table * * * * drop foreign key in the create table statement before

That is to say, at the time of data table haven't established, it has tried to delete the data tables of foreign keys,

I try to find out the ways to set up in the powerdesigner, but really can not find,
  • Related