/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERDIM') 
 CREATE TABLE T_HRCS_PINITDEMOUSERDIM (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FUSERNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDATEFIELD DATETIME,
FVALIDEND DATETIME,
FORGRANGE NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMADMINORG NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMPROJECTTEAM NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMSALARYGROUP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMCOUNTRYAREA NVARCHAR(500) DEFAULT ' ' NOT NULL,
FSCENEID INT DEFAULT 0 NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FVALIDSTARTTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FVALIDENDTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCUSTOMENABLE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBUCAFUNC NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCUSTOMENABLETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FBUCAFUNCTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FORGRANGETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMADMINORGTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMPROJECTTEAMTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMSALARYGROUPTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMCOUNTRYAREATIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERFLD_L') 
 CREATE TABLE T_HRCS_PINITDEMOUSERFLD_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPKEYTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPROPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCANREAD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCANWRITE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCANREADTIP NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCANWRITETIP NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERBD') 
 CREATE TABLE T_HRCS_PINITDEMOUSERBD (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSCENEID INT DEFAULT 0 NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FDATARULENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FPROPNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPROPKEYTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPNAMETIP NVARCHAR(100) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERDR_L') 
 CREATE TABLE T_HRCS_PINITDEMOUSERDR_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPERMITEM NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPERMITEMTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERDR') 
 CREATE TABLE T_HRCS_PINITDEMOUSERDR (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSCENEID INT DEFAULT 0 NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPERMITEM NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FDATARULENAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPERMITEMTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERBD_L') 
 CREATE TABLE T_HRCS_PINITDEMOUSERBD_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDATARULENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPROPKEYTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPNAMETIP NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERDIM_L') 
 CREATE TABLE T_HRCS_PINITDEMOUSERDIM_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FORGRANGE NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMADMINORG NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMPROJECTTEAM NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMSALARYGROUP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMCOUNTRYAREA NVARCHAR(500) DEFAULT ' ' NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FVALIDSTARTTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FVALIDENDTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCUSTOMENABLE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBUCAFUNC NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCUSTOMENABLETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FBUCAFUNCTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FORGRANGETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMADMINORGTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMPROJECTTEAMTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMSALARYGROUPTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDIMCOUNTRYAREATIP NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PINITDEMOUSERFLD') 
 CREATE TABLE T_HRCS_PINITDEMOUSERFLD (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSCENEID INT DEFAULT 0 NOT NULL,
FSCENENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FUSERNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILEORGNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFILEORGNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FROLENUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FROLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FAPPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNUMBERTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FENTITYNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FPROPKEYTIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPROPNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPROPNAMETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCANREAD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCANWRITE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCANREADTIP NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCANWRITETIP NVARCHAR(500) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL
);



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