/**Begin D:\pdm\PDM_UPGRADE1\PDM1\HDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGASKDETAILS' AND KSQL_COL_NAME ='FFINSHTIME') 
 ALTER TABLE T_HDM_REGASKDETAILS ADD (FFINSHTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGPROCESS' AND KSQL_COL_NAME ='FISOVERDUE') 
 ALTER TABLE T_HDM_REGPROCESS ADD (FISOVERDUE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGPROCESS' AND KSQL_COL_NAME ='FTRIALPERIODRSTID') 
 ALTER TABLE T_HDM_REGPROCESS ADD (FTRIALPERIODRSTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMDETAILS' AND KSQL_COL_NAME ='FFINSHTIME') 
 ALTER TABLE T_HDM_REGEXAMDETAILS ADD (FFINSHTIME DATETIME );
 EXEC p_AlterColumn 'T_HDM_REGBASEBILL_A', 'FTERMREASON', 'VARCHAR(255)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_A' AND KSQL_COL_NAME ='FPROBATIONREMARK') 
 ALTER TABLE T_HDM_REGBASEBILL_A ADD (FPROBATIONREMARK VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_A' AND KSQL_COL_NAME ='FPOSTPONEASKRESULT') 
 ALTER TABLE T_HDM_REGBASEBILL_A ADD (FPOSTPONEASKRESULT VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_A' AND KSQL_COL_NAME ='FPOSTPONEPROBATION') 
 ALTER TABLE T_HDM_REGBASEBILL_A ADD (FPOSTPONEPROBATION INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_A' AND KSQL_COL_NAME ='FPOSTPONEPROBATIONUNIT') 
 ALTER TABLE T_HDM_REGBASEBILL_A ADD (FPOSTPONEPROBATIONUNIT VARCHAR(2) DEFAULT ' ' NOT NULL );

/**End D:\pdm\PDM_UPGRADE1\PDM1\HDM_table.sql **/
