/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MRP_MONTHSENDORDER', 'T_MRP_MONTHSENDORDER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_MONTHSENDORDER') CREATE INDEX IDX_MRP_MONTHSENDORDER ON T_MRP_MONTHSENDORDER ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_MRP_MONTHSENDORDERENTRY', 'T_MRP_MONTHSENDORDERENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_STOCK_DATAFIX', 'T_MRP_STOCK_DATAFIX', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_STOCK_DATAS', 'T_MRP_STOCK_DATAS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_STOCK_DATAS') CREATE INDEX IDX_MRP_STOCK_DATAS ON T_MRP_STOCK_DATAS ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_MRP_STOCK_DATASUB', 'T_MRP_STOCK_DATASUB', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_STOCK_DATASUB') CREATE INDEX IDX_MRP_STOCK_DATASUB ON T_MRP_STOCK_DATASUB ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_MRP_WEEKSENDORDER', 'T_MRP_WEEKSENDORDER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_WEEKSENDORDER') CREATE INDEX IDX_MRP_WEEKSENDORDER ON T_MRP_WEEKSENDORDER ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_MRP_WEEKSENDORDERENTRY', 'T_MRP_WEEKSENDORDERENTRY', 'FENTRYID', '1';

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



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_constraint.sql **/
