/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION_L' AND KSQL_COL_NAME IN ('FSIMPLENAME')) 
 ALTER TABLE T_HRCS_DIMENSION_L ADD (FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FSTATUS')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FDISABLERID')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FDISABLERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FDISABLEDATE')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FDISABLEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FMASTERID')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FMASTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FISSYSPRESET')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FISSYSPRESET CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FSIMPLENAME')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FINDEX')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FINDEX BIGINT DEFAULT 0 NOT NULL );

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