/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_MATCOSTINFO', 'T_BD_MATCOSTINFO', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_BD_MATCOSTINFO_ID') CREATE INDEX IX_BD_MATCOSTINFO_ID ON T_BD_MATCOSTINFO ( FMATERIALID ,FCOSTTYPEID );


 EXEC P_ALTERPK 'PK_T_BD_MATCOSTINFO_L', 'T_BD_MATCOSTINFO_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_MATCOSTINFOENTRY', 'T_BD_MATCOSTINFOENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_BD_MATCTEN_FSUBELETID') CREATE INDEX IX_BD_MATCTEN_FSUBELETID ON T_BD_MATCOSTINFOENTRY ( FSUBELEMENTID ,FENTRYID );



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