IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_BATCHTASK_LOG' AND KSQL_COL_NAME ='FTRACEID')
 ALTER TABLE T_MSPLAN_BATCHTASK_LOG ADD (FTRACEID VARCHAR(80) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_BATCHTASK_LOG' AND KSQL_COL_NAME ='FINSTANCECOUNT')
 ALTER TABLE T_MSPLAN_BATCHTASK_LOG ADD (FINSTANCECOUNT BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_BATCHTASK_LOG' AND KSQL_COL_NAME ='FEVNTCOUNT')
 ALTER TABLE T_MSPLAN_BATCHTASK_LOG ADD (FEVNTCOUNT BIGINT  DEFAULT 0 NOT NULL);


  --t_msplan_batchtask_entry
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_BATCHTASK_ENTRY' AND KSQL_COL_NAME ='FDISPATCHTIME')
 ALTER TABLE T_MSPLAN_BATCHTASK_ENTRY ADD (FDISPATCHTIME DATETIME);

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

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_BATCHTASK_ENTRY' AND KSQL_COL_NAME ='FCONTEXT')
 ALTER TABLE T_MSPLAN_BATCHTASK_ENTRY ADD (FCONTEXT NVARCHAR(255) DEFAULT ' ' NOT NULL);

  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_BATCHTASK_ENTRY' AND KSQL_COL_NAME ='FCONTEXT_TAG')
  ALTER TABLE T_MSPLAN_BATCHTASK_ENTRY ADD (FCONTEXT_TAG NCLOB);

