IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_ADJUSTSUGGEST') 
 CREATE TABLE T_MRP_ADJUSTSUGGEST (
FID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX INT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX INT DEFAULT 0 NOT NULL,
FPLANNUM BIGINT DEFAULT 0 NOT NULL,
FSCHDULER BIGINT DEFAULT 0 NOT NULL,
FMATERIEL BIGINT DEFAULT 0 NOT NULL,
FADJUSTSUGGEST NVARCHAR(30) DEFAULT ' ' NOT NULL,
FRELEASESTATUS CHAR(1) DEFAULT '0' NOT NULL,
FORIGINDATE DATETIME,
FSUGGESTDATE DATETIME,
FADJUSTDATE DATETIME,
FSUPPLIER BIGINT DEFAULT 0 NOT NULL,
FPURCHASER BIGINT DEFAULT 0 NOT NULL,
FMATERIALATTR NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSUPPLYORG BIGINT DEFAULT 0 NOT NULL,
FBILLTYPEID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL, 
FLINENO INT DEFAULT 0 NOT NULL,
FBASEUNIT BIGINT DEFAULT 0 NOT NULL,
FQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDEALER BIGINT DEFAULT 0 NOT NULL,
FDEALDATE DATETIME,
FADJUSTCAUSE NVARCHAR(500) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_ADJUSTSUGGEST_L') 
 CREATE TABLE T_MRP_ADJUSTSUGGEST_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);
