IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_FNREPORTBK') 
 CREATE TABLE T_MDS_FNREPORTBK (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FBILLENTRYID BIGINT DEFAULT 0 NOT NULL,
FTOOLID BIGINT DEFAULT 0 NOT NULL,
FSETID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FOKDATE DATETIME,
FFINISHDATE DATETIME,
FFORDATE DATETIME,
FSETOFFDATE DATETIME,
FQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSETOFFQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSETOFFVERID BIGINT DEFAULT 0 NOT NULL,
FPLANID BIGINT DEFAULT 0 NOT NULL,
FPLANENTRYID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FROWNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFORECASTQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FHWREMAINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREMAINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEPDDATE DATETIME,
FSALEORG BIGINT DEFAULT 0 NOT NULL,
FKQDATE DATETIME,
FRPDDATE DATETIME,
FOUTSTOCKQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEXECQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORDERREMAINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBILLTYPE BIGINT DEFAULT 0 NOT NULL,
FSENDGOODSDATE DATETIME,
FORDERSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FMANUFACTUREID BIGINT DEFAULT 0 NOT NULL,
FSRCMATERIALID BIGINT DEFAULT 0 NOT NULL,
FSALREMAINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISQTYSETOFF CHAR(1) DEFAULT '0' NOT NULL,
FSETOFFLOGID BIGINT DEFAULT 0 NOT NULL
);