/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BEI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME IN ('FISPERSONPAY')) 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FISPERSONPAY CHAR(1) DEFAULT ' ' NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BEI_BANKAGENTPAYBILL', 'FSETTLETYPEID', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL' AND KSQL_COL_NAME IN ('FRETURNTIME')) 
 ALTER TABLE T_BEI_BANKPAYINGBILL ADD (FRETURNTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL' AND KSQL_COL_NAME IN ('FPAYTIME')) 
 ALTER TABLE T_BEI_BANKPAYINGBILL ADD (FPAYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL' AND KSQL_COL_NAME IN ('FPAYERNAME')) 
 ALTER TABLE T_BEI_BANKPAYINGBILL ADD (FPAYERNAME NVARCHAR(80) DEFAULT ' ' NOT NULL );

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