IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PERSONFACTOR') 
 CREATE TABLE T_FMM_PERSONFACTOR (
    FID              BIGINT          DEFAULT 0    NOT NULL,						
	FNUMBER          NVARCHAR(30)    DEFAULT ' '  NOT NULL,            
	FCREATEORGID     BIGINT          DEFAULT 0    NOT NULL,                 
	FORGID           BIGINT          DEFAULT 0    NOT NULL,               
	FCTRLSTRATEGY    NVARCHAR(50)    DEFAULT ' '  NOT NULL,   
	FSOURCEDATAID    BIGINT          DEFAULT 0    NOT NULL,            
	FBITINDEX        BIGINT          DEFAULT 0    NOT NULL,             
	FSOURCEBITINDEX  BIGINT          DEFAULT 0    NOT NULL, 
	FPART            BIGINT          DEFAULT 0    NOT NULL, 
	FDESCRIBE        NVARCHAR(255)   DEFAULT ' '  NOT NULL,       
	FAUDITORID       BIGINT          DEFAULT 0    NOT NULL,              
	FAUDITTIME       DATETIME,                               
	FNAME            NVARCHAR(255)   DEFAULT ' '  NOT NULL,             
	FSTATUS          NVARCHAR(50)    DEFAULT ' '  NOT NULL,         
	FCREATORID       BIGINT          DEFAULT 0    NOT NULL,             
	FMODIFIERID      BIGINT          DEFAULT 0    NOT NULL,             
	FENABLE          NVARCHAR(50)    DEFAULT ' '  NOT NULL,             
	FCREATETIME      DATETIME,                                
	FMODIFYTIME      DATETIME,                                   
	FMASTERID        BIGINT          DEFAULT 0    NOT NULL                
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PERSONFACTOR_L') 
 CREATE TABLE T_FMM_PERSONFACTOR_L (
    FPKID            NVARCHAR(255)   DEFAULT ' '  NOT NULL,          	
    FID              BIGINT          DEFAULT 0    NOT NULL,          
    FLOCALEID        NVARCHAR(255)   DEFAULT ' '  NOT NULL,          
    FNAME            NVARCHAR(255)   DEFAULT ' '  NOT NULL
 );
 
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PERFACTORENTRY') 
 CREATE TABLE T_FMM_PERFACTORENTRY (
	FID              BIGINT           DEFAULT 0    NOT NULL,					
	FENTRYID         BIGINT           DEFAULT 0    NOT NULL,				
	FSEQ             INT           	  DEFAULT 0    NOT NULL,					
	FINSPECTORTYPE   BIGINT           DEFAULT 0    NOT NULL,		
	FINDUSTRY        BIGINT           DEFAULT 0    NOT NULL,			
	FFACTOR          NUMERIC(23,10)   DEFAULT 0    NOT NULL
 );
 
 