/**Begin D:\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_INTELSCHEDULE') 
 CREATE TABLE T_BCM_INTELSCHEDULE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSCHEDULEPLANID VARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FEXECPLAN NVARCHAR(500) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FEXECUTORID BIGINT DEFAULT 0 NOT NULL,
FPERIODOFFSET VARCHAR(10) DEFAULT '0' NOT NULL,
FYEAROFFSET VARCHAR(10) DEFAULT '0' NOT NULL,
FISENABLE CHAR(1) DEFAULT '0' NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FENDDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_INTELSCHEDULEENTRY_L') 
 CREATE TABLE T_BCM_INTELSCHEDULEENTRY_L (
FPKID VARCHAR(30) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FOPERATIONNAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FEXECDESC NVARCHAR(1000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_INTELSCHEDULEENTRY') 
 CREATE TABLE T_BCM_INTELSCHEDULEENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FOPERATIONNAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FEXECDESC NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FMSGCONDITION VARCHAR(10) DEFAULT ' ' NOT NULL,
FMSGTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXECOPERATION CHAR(1) DEFAULT ' ' NOT NULL,
FEXECSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FMSGUSERID BIGINT DEFAULT 0 NOT NULL,
FEXECPARAMID VARCHAR(50) NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_INTELSCHEDULELOG') 
 CREATE TABLE T_BCM_INTELSCHEDULELOG (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FEXECUTORID BIGINT DEFAULT 0 NOT NULL,
FOPERATIONNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPLANID BIGINT DEFAULT 0 NOT NULL,
FEXECOPERATION VARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FDESC NVARCHAR(500) DEFAULT ' ' NOT NULL,
FBEGINTIME DATETIME,
FENDTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DSPPARAMENTITY') 
 CREATE TABLE T_BCM_DSPPARAMENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FMERGEPARAM CHAR(1) DEFAULT ' ' NOT NULL,
FOPTYPE CHAR(1) DEFAULT '1' NOT NULL,
FMULENTITY VARCHAR(2000) DEFAULT ' ' NOT NULL,
FMULPROCESS VARCHAR(2000) DEFAULT ' ' NOT NULL,
FMERGEENTITY BIGINT DEFAULT 0 NOT NULL,
FMERGERADIOGROUP CHAR(1) DEFAULT '1' NOT NULL,
FECRADIOGROUP CHAR(1) DEFAULT '1' NOT NULL,
FPCRADIOGROUP CHAR(1) DEFAULT '1' NOT NULL,
FCHKRADIOGROUP CHAR(1) DEFAULT '1' NOT NULL,
FRIGHTOFFSETGROUP CHAR(1) DEFAULT '1' NOT NULL,
FSHAREADJUSTGROUP CHAR(1) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DSPISSCHEME') 
 CREATE TABLE T_BCM_DSPISSCHEME (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DSPPARAMENTRY') 
 CREATE TABLE T_BCM_DSPPARAMENTRY (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



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