IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PLANSEGMENT')
 CREATE TABLE T_FMM_PLANSEGMENT (
	FID              BIGINT      DEFAULT 0    NOT NULL,        
	FOVERDEVICEID    BIGINT      DEFAULT 0    NOT NULL,        
	FMODELID         BIGINT      DEFAULT 0    NOT NULL,       
	FRESOURCEPLANID  BIGINT      DEFAULT 0    NOT NULL     
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PLANSEGENTRY')
 CREATE TABLE T_FMM_PLANSEGENTRY (
	FENTRYID         BIGINT         DEFAULT 0    NOT NULL,        
	FID              BIGINT         DEFAULT 0    NOT NULL,        
	FSEQ             INT            DEFAULT 0    NOT NULL,       
	FDESC            NVARCHAR(255)  DEFAULT ' '  NOT NULL,       
	FNUMBER          NVARCHAR(50)   DEFAULT ' '  NOT NULL,      
	FSTARTDATE       DATETIME,       
	FENDDATE         DATETIME   
);

