/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MDS_FORECASTCAL', 'T_MDS_FORECASTCAL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_FORECASTCAL_L', 'T_MDS_FORECASTCAL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_FORECASTCALLOG', 'T_MDS_FORECASTCALLOG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_FORECASTCALPLAN', 'T_MDS_FORECASTCALPLAN', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_FORECASTCALPLAN_L', 'T_MDS_FORECASTCALPLAN_L', 'FPKID', '1';

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



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