/**Begin D:\PDM_UPGRADE\PDM1\HDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERREASON_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSFERREASON_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERTERMREASON_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSFERTERMREASON_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSREVOKEREASON_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSREVOKEREASON_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERREASON' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_TRANSFERREASON ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERREASON' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSFERREASON ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERREASON' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_TRANSFERREASON ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERTERMREASON' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_TRANSFERTERMREASON ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERTERMREASON' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSFERTERMREASON ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERTERMREASON' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_TRANSFERTERMREASON ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSREVOKEREASON' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_TRANSREVOKEREASON ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSREVOKEREASON' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSREVOKEREASON ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSREVOKEREASON' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_TRANSREVOKEREASON ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERCLASSIFY' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_TRANSFERCLASSIFY ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERCLASSIFY' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSFERCLASSIFY ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERCLASSIFY' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_TRANSFERCLASSIFY ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERCLASSIFY_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_TRANSFERCLASSIFY_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDBACKREASON' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_SECDBACKREASON ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDBACKREASON' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_SECDBACKREASON ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDBACKREASON' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_SECDBACKREASON ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDBACKREASON_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_SECDBACKREASON_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDREASON' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_SECDREASON ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDREASON' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_SECDREASON ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDREASON' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_SECDREASON ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_SECDREASON_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_SECDREASON_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEREASON' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_PARTTIMEREASON ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEREASON' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_PARTTIMEREASON ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEREASON' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_PARTTIMEREASON ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEREASON_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_PARTTIMEREASON_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCATEGORY' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_REGCATEGORY ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCATEGORY' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGCATEGORY ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCATEGORY' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_REGCATEGORY ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCATEGORY_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGCATEGORY_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCOMMENT' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_REGCOMMENT ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCOMMENT' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGCOMMENT ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCOMMENT' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_REGCOMMENT ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGCOMMENT_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGCOMMENT_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMITEM' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_REGEXAMITEM ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMITEM' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGEXAMITEM ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMITEM' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_REGEXAMITEM ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMITEM_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGEXAMITEM_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMTYPE' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_REGEXAMTYPE ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMTYPE' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGEXAMTYPE ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMTYPE' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_REGEXAMTYPE ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGEXAMTYPE_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGEXAMTYPE_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGTESTMODEL' AND KSQL_COL_NAME ='FORINUMBER')
 ALTER TABLE T_HDM_REGTESTMODEL ADD (FORINUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGTESTMODEL' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGTESTMODEL ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGTESTMODEL' AND KSQL_COL_NAME ='FORISTATUS')
 ALTER TABLE T_HDM_REGTESTMODEL ADD (FORISTATUS VARCHAR(2) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGTESTMODEL_L' AND KSQL_COL_NAME ='FORINAME')
 ALTER TABLE T_HDM_REGTESTMODEL_L ADD (FORINAME NVARCHAR(100) DEFAULT ' ' NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\HDM_table.sql **/
