/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_DECLARE_EXT') 
 CREATE TABLE T_TCTB_DECLARE_EXT (
FID BIGINT DEFAULT 0 NOT NULL,
FKJZG VARCHAR(50) DEFAULT ' ' NOT NULL,
FDLSB VARCHAR(50) DEFAULT ' ' NOT NULL,
FDLSBZJJG VARCHAR(50) DEFAULT ' ' NOT NULL,
FJBR VARCHAR(50) DEFAULT ' ' NOT NULL,
FBLRYSFZJLX VARCHAR(50) DEFAULT ' ' NOT NULL,
FSLR VARCHAR(50) DEFAULT ' ' NOT NULL,
FZGSWJG VARCHAR(50) DEFAULT ' ' NOT NULL,
FFDDBRQZRQ DATETIME,
FTBRQ DATETIME,
FBLR VARCHAR(50) DEFAULT ' ' NOT NULL,
FDLSBRQ DATETIME,
FJBRZYZJHM VARCHAR(50) DEFAULT ' ' NOT NULL,
FBLRYSFZJHM VARCHAR(50) DEFAULT ' ' NOT NULL,
FSLRQ DATETIME,
FKSZJGXZQH VARCHAR(50) DEFAULT ' ' NOT NULL,
FSBBID VARCHAR(50) DEFAULT ' ' NOT NULL,
FEWBLXH VARCHAR(50) DEFAULT ' ' NOT NULL,
FEWBLNAME VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_DECLARE_MAIN') 
 CREATE TABLE T_TCTB_DECLARE_MAIN (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) 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,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FEWBLXH VARCHAR(50) DEFAULT ' ' NOT NULL,
FTEMPLATEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXLIMIT VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDECLARESTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FNSRTYPE VARCHAR(36) DEFAULT ' ' NOT NULL,
FSBRQ DATETIME,
FSBLX VARCHAR(50) DEFAULT ' ' NOT NULL,
FSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FBQYBTSE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYSSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFDDBRXM VARCHAR(50) DEFAULT ' ' NOT NULL,
FZCDZ VARCHAR(300) DEFAULT ' ' NOT NULL,
FSCJYDZ VARCHAR(300) DEFAULT ' ' NOT NULL,
FKHYH VARCHAR(120) DEFAULT ' ' NOT NULL,
FYHZH VARCHAR(50) DEFAULT ' ' NOT NULL,
FREGISTERTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONENUM VARCHAR(50) DEFAULT ' ' NOT NULL,
FTCRETTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FNSRSBH VARCHAR(50) DEFAULT ' ' NOT NULL,
FNSRMC VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPANAGE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSSHYMC VARCHAR(50) DEFAULT ' ' NOT NULL
);


 EXEC p_AlterColumn 'T_TCTB_LABEL_TYPE_L', 'FDESCRIBE', 'VARCHAR(255)', 'NOT NULL', '0100', ''' ''';


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