EXEC p_DropIdx 'IDX_INVOICE_FINVOICECODE', 'T_ER_CHECKINGINVOICE';
EXEC p_DropIdx 'IDX_INVOICE_FINVOICENO', 'T_ER_CHECKINGINVOICE';
EXEC p_DropIdx 'IDX_INVOICE_FCHECKINGNO', 'T_ER_CHECKINGINVOICE';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_ER_CHECKINGINVOICE' AND KSQL_INDNAME = 'IDX_INVOICE_FINVOICECODE')
CREATE INDEX IDX_INVOICE_FINVOICECODE ON T_ER_CHECKINGINVOICE (FINVOICECODE );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_ER_CHECKINGINVOICE' AND KSQL_INDNAME = 'IDX_INVOICE_FINVOICENO')
CREATE INDEX IDX_INVOICE_FINVOICENO ON T_ER_CHECKINGINVOICE (FINVOICENO );
EXEC p_AlterColumn 'T_ER_TRAINCHECKINGBILL', 'FDOWNLOADLINK', 'VARCHAR(2000)', 'NOT NULL', '0100', ''' ''';
EXEC p_AlterColumn 'T_ER_TRAINCHECKINGBILL', 'FKDDOWNLOADLINK', 'VARCHAR(2000)', 'NOT NULL', '0100', ''' ''';
EXEC p_AlterColumn 'T_ER_CHECKINGINVOICE', 'FCHECKINGBILLNO', 'VARCHAR(1000)', 'NOT NULL', '0100', ''' ''';
EXEC p_AlterColumn 'T_ER_CHECKINGINVOICE', 'FDOWNLOADURL', 'VARCHAR(2000)', 'NOT NULL', '0100', ''' ''';
EXEC p_AlterColumn 'T_ER_CHECKINGINVOICE', 'FINNERDOWNLOADURL', 'VARCHAR(2000)', 'NOT NULL', '0100', ''' ''';
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGINVOICE' AND KSQL_COL_NAME ='FDEPARTTIME')
ALTER TABLE T_ER_CHECKINGINVOICE ADD (FDEPARTTIME VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGINVOICE' AND KSQL_COL_NAME ='FNUMBER')
ALTER TABLE T_ER_CHECKINGINVOICE ADD (FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL );