/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BEI_constraint.sql **/
 EXEC p_AlterPK 'PK_T_BEI_BANKLOG', 'T_BEI_BANKLOG', 'FId', '0';
EXEC p_DropIdx 'IDX_BEI_BANKLOG', 'T_BEI_BANKLOG';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_BANKLOG') CREATE  CLUSTERED INDEX IDX_BEI_BANKLOG ON T_BEI_BANKLOG ( FCOMPANYID ,FTIME ,FISEXCEPTION );

EXEC p_DropIdx 'IDX_BEI_SERVICECONFIG', 'T_BEI_SERVICECONFIG';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_SERVICECONFIG') CREATE INDEX IDX_BEI_SERVICECONFIG ON T_BEI_SERVICECONFIG ( FNUMBER ,FORGID );

 EXEC P_ALTERPK 'PK_T_BEI_BANKLOG_BAK', 'T_BEI_BANKLOG_BAK', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_BANKLOG_BAK') CREATE  CLUSTERED INDEX IDX_BEI_BANKLOG_BAK ON T_BEI_BANKLOG_BAK ( FCOMPANYID ,FTIME ,FISEXCEPTION );


 EXEC P_ALTERPK 'PK_T_BEI_BANKLOG_BAK_L', 'T_BEI_BANKLOG_BAK_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_TMC_INIT_L', 'T_TMC_INIT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TMC_INIT_L') CREATE INDEX IDX_TMC_INIT_L ON T_TMC_INIT_L ( FID ,FNAME ,FCOMMENT );


 EXEC P_ALTERPK 'PK_T_TMC_INIT', 'T_TMC_INIT', 'FID', '1';

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



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