IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INVENTORYLOG') 
 CREATE TABLE T_PUR_INVENTORYLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FOPERATETIME DATETIME,
FOPERATION NVARCHAR(100) DEFAULT ' ' NOT NULL,
FOPERATORID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERSTOCK') 
 CREATE TABLE T_PUR_SUPPLIERSTOCK (
FID BIGINT DEFAULT 0 NOT NULL,
FUPDATETIME DATETIME,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FINVENTORYQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORDERQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUPDATELOG NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL
);