How to create a Composite Primary Key in SAP PowerDesigner

796 views Asked by At

I have a join table and I would like to create a composite primary key for it, like so:

PRIMARY KEY ('table1fk' , 'table2fk') 

How would I do this via the SAP PowerDesigner table/column editor?

1

There are 1 answers

0
pascal On

After joining your table to the other tables, you mark the Foreign Key migrated from the other tables, as Primary Key.

enter image description here

Which gives the following SQL script:

create table PARTICIPATION (
POLL_ID              int                  not null,
USER_ID              int                  not null,
primary key (POLL_ID, USER_ID),
foreign key (POLL_ID)
      references POLL (ID),
foreign key (USER_ID)
      references "USER" (ID)
);