 /**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_MRP_MULTIORGSUPDEM_L', 'T_MRP_MULTIORGSUPDEM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_MULTIORGSUPDEM_L_FK') CREATE INDEX IDX_MRP_MULTIORGSUPDEM_L_FK ON T_MRP_MULTIORGSUPDEM_L ( FLOCALEID );


 EXEC P_ALTERPK 'PK_MRP_DEFAULTSUPPLY', 'T_MRP_DEFAULTSUPPLY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_DEFAULTSUPPLY_FK') CREATE INDEX IDX_MRP_DEFAULTSUPPLY_FK ON T_MRP_DEFAULTSUPPLY ( FID );


 EXEC P_ALTERPK 'PK_MRP_NODEDETAILS', 'T_MRP_NODEDETAILS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_NODEDETAILS_FK') CREATE INDEX IDX_MRP_NODEDETAILS_FK ON T_MRP_NODEDETAILS ( FPARENTDNYID );


 EXEC P_ALTERPK 'PK_MRP_SHOWENTITY', 'T_MRP_SHOWENTITY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_SHOWENTITY_FK') CREATE INDEX IDX_MRP_SHOWENTITY_FK ON T_MRP_SHOWENTITY ( FID );


 EXEC P_ALTERPK 'PK_MRP_INVSTOCKTYPE', 'T_MRP_INVSTOCKTYPE', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_INVSTOCKTYPE_FK') CREATE INDEX IDX_MRP_INVSTOCKTYPE_FK ON T_MRP_INVSTOCKTYPE ( FID );


 EXEC P_ALTERPK 'PK_MRP_INVSTOCKSTATUS', 'T_MRP_INVSTOCKSTATUS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_INVSTOCKSTATUS_FK') CREATE INDEX IDX_MRP_INVSTOCKSTATUS_FK ON T_MRP_INVSTOCKSTATUS ( FID );
 
  EXEC P_ALTERPK 'PK_MRP_MULTIORGSUPDEM', 'T_MRP_MULTIORGSUPDEM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_MULTIORGSUPDEM_FK') CREATE INDEX IDX_MRP_MULTIORGSUPDEM_FK ON T_MRP_MULTIORGSUPDEM ( FNUMBER );



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/