/**Begin D:\pdm\PDM_UPGRADE\PDM1\HRPTMC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_REPORTMANAGE' AND KSQL_COL_NAME ='FDRILLINGDRL') 
 ALTER TABLE T_HRPTMC_REPORTMANAGE ADD (FDRILLINGDRL NVARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_REPORTCONFIG' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_REPORTCONFIG ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_DIMMAP' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_DIMMAP ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_ROWFIELD' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_ROWFIELD ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_COLFIELD' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_COLFIELD ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_CUSTOMSORT' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_CUSTOMSORT ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_DISPSCMCHG' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_DISPSCMCHG ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_RPTDISPSCM' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_RPTDISPSCM ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_USERDISPSCM' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_USERDISPSCM ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_RPTJUMP' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_RPTJUMP ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRPTMC_RPTCOMREF' AND KSQL_COL_NAME ='FWORKRPTID') 
 ALTER TABLE T_HRPTMC_RPTCOMREF ADD (FWORKRPTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRPTMC_WORKREPORT') 
 CREATE TABLE T_HRPTMC_WORKREPORT (
FID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FKEY INT DEFAULT 0 NOT NULL,
FROW NCLOB,
FCOLUMN NCLOB,
FRPTMANAGEID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\pdm\PDM_UPGRADE\PDM1\HRPTMC_table.sql **/
