/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MEMBERPERM') 
 CREATE TABLE T_EB_MEMBERPERM (
FID BIGINT DEFAULT 0 NOT NULL,
FRANGE VARCHAR(30) DEFAULT ' ' NOT NULL,
FPERMISSION VARCHAR(30) DEFAULT ' ' NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FMEMBERTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FMEMBER BIGINT DEFAULT 0 NOT NULL,
FUSERTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FUSERSID BIGINT DEFAULT 0 NOT NULL,
FISCUSTOMPROP CHAR(1) DEFAULT ' ' NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MEMBERPERM_L') 
 CREATE TABLE T_EB_MEMBERPERM_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FMEMBERNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(200) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MODELPERM') 
 CREATE TABLE T_EB_MODELPERM (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MODELPERM_L') 
 CREATE TABLE T_EB_MODELPERM_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FUSERNAME NVARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MODELPERMENTRY') 
 CREATE TABLE T_EB_MODELPERMENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERS BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFAUDITTRIAL_L') 
 CREATE TABLE T_EB_STRUCTOFAUDITTRIAL_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFCURRENCY_L') 
 CREATE TABLE T_EB_STRUCTOFCURRENCY_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFFY_L') 
 CREATE TABLE T_EB_STRUCTOFFY_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFPERIOD_L') 
 CREATE TABLE T_EB_STRUCTOFPERIOD_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FANOTHERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFVERSION_L') 
 CREATE TABLE T_EB_STRUCTOFVERSION_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFDEFINED_L') 
 CREATE TABLE T_EB_STRUCTOFDEFINED_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MODEL') 
 CREATE TABLE T_EB_MODEL (
FID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTARTFY VARCHAR(2) DEFAULT ' ' NOT NULL,
FBEGINPERIOD VARCHAR(2) DEFAULT ' ' NOT NULL,
FPRESETYEAR INT DEFAULT 0 NOT NULL,
FISDETAILTOMONTH CHAR(1) DEFAULT ' ' NOT NULL,
FMINCLUDEQRT CHAR(1) DEFAULT ' ' NOT NULL,
FMINCLUDEYEAR CHAR(1) DEFAULT ' ' NOT NULL,
FISDETAILTOQRT CHAR(1) DEFAULT ' ' NOT NULL,
FISDETAILTOHALFYEAR CHAR(1) DEFAULT ' ' NOT NULL,
FMODELTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FBEGINYEAROFMONTH VARCHAR(2) DEFAULT ' ' NOT NULL,
FBEGINPERIODTXT NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCURRENCY VARCHAR(255) DEFAULT ' ' NOT NULL,
FDEFINEDDIM VARCHAR(100) DEFAULT ' ' NOT NULL,
FREPORTTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FPERMCONTROL VARCHAR(10) DEFAULT ' ' NOT NULL,
FQRTINCLUDEYEAR CHAR(1) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FMONTHINCLUDE13 CHAR(1) DEFAULT ' ' NOT NULL,
FSHOWNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISSPPTPROJECT CHAR(1) DEFAULT ' ' NOT NULL,
FVERSION BIGINT DEFAULT 0 NOT NULL 
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_USERSELECT') 
 CREATE TABLE T_EB_USERSELECT (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FFYEARSTRUCTID BIGINT DEFAULT 0 NOT NULL,
FPERIODSTRUCTID BIGINT DEFAULT 0 NOT NULL,
FSCENESTRUCTID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYSTRUCTID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAPPLICATION VARCHAR(4) DEFAULT ' ' NOT NULL,
FONLYMODEL CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FFORMID VARCHAR(50) DEFAULT ' ' NOT NULL,
FVERSIONSTRUCTID BIGINT DEFAULT 0 NOT NULL,
FCSLSCHEME BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFMETRIC_L') 
 CREATE TABLE T_EB_STRUCTOFMETRIC_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFCHANGETYPE_L') 
 CREATE TABLE T_EB_STRUCTOFCHANGETYPE_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFENT_L') 
 CREATE TABLE T_EB_STRUCTOFENT_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFICENTITY_L') 
 CREATE TABLE T_EB_STRUCTOFICENTITY_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFFY') 
 CREATE TABLE T_EB_STRUCTOFFY (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ',
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFICENTITY') 
 CREATE TABLE T_EB_STRUCTOFICENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFPERIOD') 
 CREATE TABLE T_EB_STRUCTOFPERIOD (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FEFFDATE VARCHAR(30) DEFAULT ' ' NOT NULL,
FEXPDATE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREFEREDSTATUS INT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FEFFMONTH VARCHAR(2) DEFAULT ' ' NOT NULL,
FEFFDAY VARCHAR(2) DEFAULT ' ' NOT NULL,
FEXPMONTH VARCHAR(2) DEFAULT ' ' NOT NULL,
FEXPDAY VARCHAR(2) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FANOTHERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFAUDITTRIAL') 
 CREATE TABLE T_EB_STRUCTOFAUDITTRIAL (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FISDATACOLLECT CHAR(1) DEFAULT '0' NOT NULL,
FUSE NVARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFCHANGETYPE') 
 CREATE TABLE T_EB_STRUCTOFCHANGETYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FCHANGEWAY CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFCURRENCY') 
 CREATE TABLE T_EB_STRUCTOFCURRENCY (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFENT') 
 CREATE TABLE T_EB_STRUCTOFENT (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FISINNERORG CHAR(1) DEFAULT ' ' NOT NULL,
FEFFDATE DATETIME,
FEXPDATE DATETIME,
FDESCRIPTION NVARCHAR(255),
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSHOWNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FISEXCHANGERATE CHAR(1) DEFAULT '0' NOT NULL,
FORGCODE VARCHAR(9) DEFAULT ' ' NOT NULL,
FOWNER BIGINT DEFAULT 0 NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FEXECUTOR BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFVERSION') 
 CREATE TABLE T_EB_STRUCTOFVERSION (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FISACTUAL CHAR(1) DEFAULT '0' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFDATETYPE') 
 CREATE TABLE T_EB_STRUCTOFDATETYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FEDITTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FDATEOFSTART DATETIME,
FBIZMODEL BIGINT DEFAULT 0 NOT NULL,
FDATAVERSION BIGINT DEFAULT 0 NOT NULL,
FDATAYEAR BIGINT DEFAULT 0 NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFDATETYPE_L') 
 CREATE TABLE T_EB_STRUCTOFDATETYPE_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFDEFINED') 
 CREATE TABLE T_EB_STRUCTOFDEFINED (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FDATATYPE CHAR(1) DEFAULT '0' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FVALUE BIGINT DEFAULT 0 NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FISSEQ CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFMETRIC') 
 CREATE TABLE T_EB_STRUCTOFMETRIC (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FREFERID BIGINT DEFAULT 0 NOT NULL,
FVERSIONTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FDATATYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FISAGG CHAR(1) DEFAULT '1' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DIMENSION')
CREATE TABLE T_EB_DIMENSION (
FID                  BIGINT             DEFAULT 0  NOT NULL ,
FNAME                NVARCHAR(50)       DEFAULT ' '  NOT NULL ,
FNUMBER              NVARCHAR(50)       DEFAULT ' '  NOT NULL ,
FSHORTNUMBER         VARCHAR(3)         DEFAULT ' '  NOT NULL ,
FISSYSDIMENSION      CHAR(1)            DEFAULT ' '  NOT NULL ,
FDSEQ                INT                DEFAULT 0  NOT NULL ,
FMODELID             BIGINT             DEFAULT 0  NOT NULL ,
FDESCRIPTION         NVARCHAR(255)      DEFAULT ' '  NOT NULL ,
FCREATORID           BIGINT             DEFAULT 0 NOT NULL ,
FCREATETIME          DATETIME             ,
FMODIFIERID          BIGINT             DEFAULT 0  NOT NULL ,
FMODIFYTIME          DATETIME             ,
FSTATUS              NVARCHAR(5)         DEFAULT ' '  NOT NULL ,
FENABLE              NVARCHAR(5)         DEFAULT ' '  NOT NULL ,
FDISABLERID          BIGINT             DEFAULT 0  NOT NULL ,
FDISABLEDATE         DATETIME             ,
FMEMBERMODEL         NVARCHAR(50)        DEFAULT ' '  NOT NULL ,
FMEMBERTABLE         NVARCHAR(50)        DEFAULT ' '  NOT NULL ,
FFIELDMAPPED         NVARCHAR(50)       DEFAULT ' '  NOT NULL ,
FMASTERID            BIGINT             DEFAULT 0  NOT NULL ,
FVERSION 			 BIGINT 			DEFAULT 0 NOT NULL 
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFACCOUNT') 
 CREATE TABLE T_EB_STRUCTOFACCOUNT (
FID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSTORAGETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FAGGOPRT CHAR(1) DEFAULT ' ' NOT NULL,
FEXCHANGE VARCHAR(30) DEFAULT ' ' NOT NULL,
FACCOUNTUSE CHAR(1) DEFAULT ' ' NOT NULL,
FACCOUNTTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDRCRDIRECT CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERSOURCE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STRUCTOFACCOUNT_L') 
 CREATE TABLE T_EB_STRUCTOFACCOUNT_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FANOTHERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DIMENSION_L') 
 CREATE TABLE T_EB_DIMENSION_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MODEL_L') 
 CREATE TABLE T_EB_MODEL_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);




IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BIZRULECATALOG') 
 CREATE TABLE T_EB_BIZRULECATALOG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BIZRULECATALOG_L') 
 CREATE TABLE T_EB_BIZRULECATALOG_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BIZRULEGLOBAL') 
 CREATE TABLE T_EB_BIZRULEGLOBAL (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FVERSION INT DEFAULT 0 NOT NULL,
FGLOBALENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);







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