/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_VCHBUILDSCH') 
 CREATE TABLE T_AI_VCHBUILDSCH (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FISSHARE CHAR(1) DEFAULT '0' NOT NULL,
FSCHEMENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_VCHBUILDSCHENTRY') 
 CREATE TABLE T_AI_VCHBUILDSCHENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTBOOK BIGINT DEFAULT 0 NOT NULL,
FPERIOD BIGINT DEFAULT 0 NOT NULL,
FBIZORG BIGINT DEFAULT 0 NOT NULL,
FISREFRESH CHAR(1) DEFAULT '0' NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_VCHBUILDSCHSUB') 
 CREATE TABLE T_AI_VCHBUILDSCHSUB (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FUNIONTYPE NVARCHAR(50) DEFAULT '0' NOT NULL,
FSOURCEBILL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMATCHFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMATCHFIELDKEY NVARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AI_table.sql **/
