

/** 加字段 **/


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_BILLLK' AND KSQL_COL_NAME ='fstatus')
 ALTER TABLE T_CTBOTP_BILLLK ADD (fstatus CHAR(1) DEFAULT '0' NOT NULL );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_BILLLK' AND KSQL_COL_NAME ='fdelstatus')
 ALTER TABLE T_CTBOTP_BILLLK ADD (fdelstatus CHAR(1) DEFAULT '0' NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_BILLLK' AND KSQL_COL_NAME ='fdeletetime')
 ALTER TABLE T_CTBOTP_BILLLK ADD (fdeletetime DATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_BILLLK' AND KSQL_COL_NAME ='fupdatetime')
 ALTER TABLE T_CTBOTP_BILLLK ADD (fupdatetime DATETIME );

/** 加字段 **/

/** 加索引 **/

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_BILLLK_STATUS') CREATE INDEX IDX_CTBOTP_BILLLK_STATUS ON T_CTBOTP_BILLLK ( FSTATUS );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_BILLLK_DELSTATUS') CREATE INDEX IDX_CTBOTP_BILLLK_DELSTATUS ON T_CTBOTP_BILLLK ( FDELSTATUS );

  IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_BILLLK_DELETETIME') CREATE INDEX IDX_CTBOTP_BILLLK_DELETETIME ON T_CTBOTP_BILLLK ( FDELETETIME );

  IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_BILLLK_CREATETIME') CREATE INDEX IDX_CTBOTP_BILLLK_CREATETIME ON T_CTBOTP_BILLLK ( FCREATETIME );
/** 加索引 **/








