/**Begin D:\pdm1\RIM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_VERIFY_MODIFY_HIS') 
 CREATE TABLE T_RIM_VERIFY_MODIFY_HIS (
FID BIGINT DEFAULT 0 NOT NULL,
FSERIAL_NO NVARCHAR(36) DEFAULT ' ' NOT NULL,
FMODIFY_KEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODIFY_NAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBEFORE_VALUE NVARCHAR(300) DEFAULT ' ' NOT NULL,
FAFTER_VALUE NVARCHAR(300) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FMODIFIER NVARCHAR(36) DEFAULT ' ' NOT NULL
);




IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_FINANCIAL' AND KSQL_COL_NAME ='FEXPENSE_STATUS')
 ALTER TABLE T_RIM_INV_FINANCIAL ADD (FEXPENSE_STATUS NVARCHAR(2) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_FINANCIAL' AND KSQL_COL_NAME ='FACCOUNT_DATE')
 ALTER TABLE T_RIM_INV_FINANCIAL ADD (FACCOUNT_DATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_FINANCIAL' AND KSQL_COL_NAME ='FORIGINAL_STATE')
 ALTER TABLE T_RIM_INV_FINANCIAL ADD (FORIGINAL_STATE NVARCHAR(2) );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_REFUND' AND KSQL_COL_NAME ='FEXPENSE_STATUS')
 ALTER TABLE T_RIM_INV_TRAIN_REFUND ADD (FEXPENSE_STATUS NVARCHAR(2) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_REFUND' AND KSQL_COL_NAME ='FACCOUNT_DATE')
 ALTER TABLE T_RIM_INV_TRAIN_REFUND ADD (FACCOUNT_DATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_REFUND' AND KSQL_COL_NAME ='FORIGINAL_STATE')
 ALTER TABLE T_RIM_INV_TRAIN_REFUND ADD (FORIGINAL_STATE NVARCHAR(2) );

/**End D:\pdm1\RIM_table.sql **/
