/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_CSGROUPSTANDARD_L', 'T_BD_CSGROUPSTANDARD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_CUSTOMERGROUPDETAIL', 'T_BD_CUSTOMERGROUPDETAIL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_SPGROUPSTANDARD_L', 'T_BD_SPGROUPSTANDARD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_SUPPLIERGROUPDETAIL', 'T_BD_SUPPLIERGROUPDETAIL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_CSGROUPSTANDARD', 'T_BD_CSGROUPSTANDARD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_SPGROUPSTANDARD', 'T_BD_SPGROUPSTANDARD', 'FID', '1';

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




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