/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
EXEC p_DropIdx 'T_BCM_ISDimMapSrcDefVal_l_FID', 'T_BCM_ISDIMMAPSRCDEFVAL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPSRCDEFVAL_L_FID') CREATE INDEX T_BCM_ISDIMMAPSRCDEFVAL_L_FID ON T_BCM_ISDIMMAPSRCDEFVAL_L ( FDETAILID );

EXEC p_DropIdx 'T_BCM_ISDimMapTargDefVal_l_FID', 'T_BCM_ISDIMMAPTARGDEFVAL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPTARGDEFVAL_L_FID') CREATE INDEX T_BCM_ISDIMMAPTARGDEFVAL_L_FID ON T_BCM_ISDIMMAPTARGDEFVAL_L ( FDETAILID );

 EXEC P_ALTERPK 'PK_T_BCM_ANNACCOUNTBEFORE', 'T_BCM_ANNACCOUNTBEFORE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ANNUALACCOUNT', 'T_BCM_ANNUALACCOUNT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BCM_ANNUALACCOUNT_MODEL') CREATE INDEX IDX_T_BCM_ANNUALACCOUNT_MODEL ON T_BCM_ANNUALACCOUNT ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_STRUCTOFENTPART', 'T_BCM_STRUCTOFENTPART', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_STRUCTOFENTPART') CREATE INDEX IDX_BCM_STRUCTOFENTPART ON T_BCM_STRUCTOFENTPART ( FMERGERNODE ,FISOFFSETENTRY );



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