/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_QYSDS_EXT_DYN') 
 CREATE TABLE T_TCCIT_QYSDS_EXT_DYN (
FID BIGINT DEFAULT 0 NOT NULL,
FEWBLXH VARCHAR(50) DEFAULT ' ' NOT NULL,
FEWBLNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSBBID VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FITEM BIGINT DEFAULT 0 NOT NULL,
FROWNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_QYSDS_EXT_DYN2') 
 CREATE TABLE T_TCCIT_QYSDS_EXT_DYN2 (
FID BIGINT DEFAULT 0 NOT NULL,
FEWBLXH VARCHAR(50) DEFAULT ' ' NOT NULL,
FEWBLNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSBBID VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FITEM BIGINT DEFAULT 0 NOT NULL,
FROWNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_EXT' AND KSQL_COL_NAME ='FITEM') 
 ALTER TABLE T_TCCIT_QYSDS_EXT ADD (FITEM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_EXT' AND KSQL_COL_NAME ='FROWNUMBER') 
 ALTER TABLE T_TCCIT_QYSDS_EXT ADD (FROWNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_QYSDS_EXT_DYN3') 
 CREATE TABLE T_TCCIT_QYSDS_EXT_DYN3 (
FID BIGINT DEFAULT 0 NOT NULL,
FEWBLXH VARCHAR(50) DEFAULT ' ' NOT NULL,
FEWBLNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSBBID VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FITEM BIGINT DEFAULT 0 NOT NULL,
FROWNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNAME VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_NONTAX_SUMMARY_M' AND KSQL_COL_NAME ='FITEM') 
 ALTER TABLE T_TCCIT_NONTAX_SUMMARY_M ADD (FITEM BIGINT DEFAULT 0 NOT NULL );

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