/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYCHGBILLENTRY' AND KSQL_COL_NAME ='FBIZDATE') 
 ALTER TABLE T_CAS_PAYCHGBILLENTRY ADD (FBIZDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYCHGBILLENTRY' AND KSQL_COL_NAME ='FAFTERBIZDATE') 
 ALTER TABLE T_CAS_PAYCHGBILLENTRY ADD (FAFTERBIZDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME ='FNETBANKACCTID') 
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FNETBANKACCTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME ='FEXRATETABLEID') 
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FEXRATETABLEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME ='FISAGENCYPERSONPAY') 
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FISAGENCYPERSONPAY CHAR(1) DEFAULT ' ' NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_CAS_AGENTPAYBILL_E', 'FONLINEBANKACCTID', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME ='FEXRATETABLEID') 
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FEXRATETABLEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME ='FCTLVOUCHERPARAM') 
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FCTLVOUCHERPARAM VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME ='FNETBANKACCTID') 
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FNETBANKACCTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME ='FCTLVOUCHERPARAM') 
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FCTLVOUCHERPARAM VARCHAR(30) DEFAULT ' ' NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_CAS_PAYMENTBILL_E', 'FONLINEBANKACCTID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_CAS_PAYMENTBILL_E', 'FISCHANGE', 'NULL', 'NULL', '1001', 'NULL';


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