/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MRP_PURFOREENTRY', 'T_MRP_PURFOREENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_PURFOREENTRY') CREATE INDEX IDX_MRP_PURFOREENTRY ON T_MRP_PURFOREENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_MRP_PURFOREHISTORY', 'T_MRP_PURFOREHISTORY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_PURFOREHISTORY_L', 'T_MRP_PURFOREHISTORY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_PURFOREHISTORY_L') CREATE INDEX IDX_MRP_PURFOREHISTORY_L ON T_MRP_PURFOREHISTORY_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_MRP_MFTSTOCKDMDBILL', 'T_MRP_MFTSTOCKDMDBILL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_MFTSTOCKDMDBILL_L', 'T_MRP_MFTSTOCKDMDBILL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_MFTSTOCKDMDBILL_L') CREATE INDEX IDX_MRP_MFTSTOCKDMDBILL_L ON T_MRP_MFTSTOCKDMDBILL_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_MRP_MFTSTOCKDMDBILLENT', 'T_MRP_MFTSTOCKDMDBILLENT', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_MFTSTOCKDMDBILLENT') CREATE INDEX IDX_MRP_MFTSTOCKDMDBILLENT ON T_MRP_MFTSTOCKDMDBILLENT ( FID ,FSEQ );




 EXEC P_ALTERPK 'PK_T_MRP_PURFORECASTENTRY', 'T_MRP_PURFORECASTENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_PURFORECASTENTRY') CREATE INDEX IDX_MRP_PURFORECASTENTRY ON T_MRP_PURFORECASTENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_MRP_PURFORECAST', 'T_MRP_PURFORECAST', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_PURFORECAST') CREATE INDEX IDX_MRP_PURFORECAST ON T_MRP_PURFORECAST ( FBILLNO ,FPLANORGID );



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