/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_STRUCTOFACCOUNTP', 'T_BCM_STRUCTOFACCOUNTP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_STRUCTOFACCOUNTP_IDX') CREATE INDEX T_BCM_STRUCTOFACCOUNTP_IDX ON T_BCM_STRUCTOFACCOUNTP ( FISACCOUNTOFFSET );


 EXEC P_ALTERPK 'PK_T_BCM_DATETYPETODIM', 'T_BCM_DATETYPETODIM', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_MEMBOFDATASORT', 'T_BCM_MEMBOFDATASORT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_MEMBOFDATASORT_L', 'T_BCM_MEMBOFDATASORT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_SPCONFIG', 'T_BCM_SPCONFIG', 'ID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_SPCONFIG') CREATE INDEX IDX_BCM_SPCONFIG ON T_BCM_SPCONFIG ( FMODELID ,FSCENARIOID );


 EXEC P_ALTERPK 'PK_T_BCM_STRUCTOFDATASORT', 'T_BCM_STRUCTOFDATASORT', 'FID', '1';

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

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DATASORT_LONGNUM') CREATE INDEX IDX_BCM_DATASORT_LONGNUM ON T_BCM_STRUCTOFDATASORT ( FLONGNUMBER );


 EXEC P_ALTERPK 'PK_T_BCM_STRUCTOFDATASORT_L', 'T_BCM_STRUCTOFDATASORT_L', 'FPKID', '1';

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



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BCM_constraint.sql **/
