/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_CARD_BIZ_CTR') 
 CREATE TABLE T_FA_CARD_BIZ_CTR (
FID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLENTITYNAME VARCHAR(30) DEFAULT 'NOENTITYNAME' NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETSPLITENTRY_D' AND KSQL_COL_NAME ='FASSETNAME') 
 ALTER TABLE T_FA_ASSETSPLITENTRY_D ADD (FASSETNAME NVARCHAR(300) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_META_BILL_REALCARD_R') 
 CREATE TABLE T_FA_META_BILL_REALCARD_R (
FID BIGINT DEFAULT 0 NOT NULL,
FREALFIELD VARCHAR(30) DEFAULT ' ' NOT NULL,
FREALENTITY VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLENTITYNAME VARCHAR(30) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_CARD_BIZCTR_BILLSET') 
 CREATE TABLE T_FA_CARD_BIZCTR_BILLSET (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT 'A' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAUDITDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FBILLENTITYNAME VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLENTITYNAMECN VARCHAR(80) DEFAULT 'NOENTITYNAME' NOT NULL,
FUSEPURPOSE VARCHAR(30) DEFAULT ' ' NOT NULL,
FREMARK VARCHAR(30) DEFAULT ' ' NOT NULL
);



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