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

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


 EXEC P_ALTERPK 'PK_T_BD_BIZPARTNERUNITCODE_L', 'T_BD_BIZPARTNERUNITCODE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_BPUNITCODEREG', 'T_BD_BPUNITCODEREG', 'FENTRYID', '1';

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



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