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

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


 EXEC P_ALTERPK 'PK_T_BD_MATERIALGROUPDETAIL', 'T_BD_MATERIALGROUPDETAIL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MATERIALGROUPDETAIL_GROUP') CREATE INDEX IDX_MATERIALGROUPDETAIL_GROUP ON T_BD_MATERIALGROUPDETAIL ( FGROUPID );


 EXEC P_ALTERPK 'PK_T_BD_MTGROUPSTANDARD_L', 'T_BD_MTGROUPSTANDARD_L', 'FPKID', '1';

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



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