/**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_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FINCOMESWIFTCODE') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FINCOMESWIFTCODE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FINCOMEBANKCODE') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FINCOMEBANKCODE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FINCOMERADDS') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FINCOMERADDS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FPAYMENTMETHOD') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FPAYMENTMETHOD NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FTRANSREMARKS') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FTRANSREMARKS NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FDELIVERYMETHOD') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FDELIVERYMETHOD NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FCHEQUETYPE') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FCHEQUETYPE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAY_ENTRY' AND KSQL_COL_NAME ='FCHEQUEUSAGE') 
 ALTER TABLE T_BEI_BANKAGENTPAY_ENTRY ADD (FCHEQUEUSAGE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FUSECN') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FUSECN NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FTOLEXCHANGERATE') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FTOLEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FEXCONTRACT') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FEXCONTRACT NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPAYERFEETYPE') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPAYERFEETYPE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPAYERFEEACCNO') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPAYERFEEACCNO NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPAYERFEECURRENCYID') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPAYERFEECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FSERVICELEVEL') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FSERVICELEVEL NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPROXYACCNO') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPROXYACCNO NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPROXYACCNAME') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPROXYACCNAME NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPROXYBANKCOUNTRY') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPROXYBANKCOUNTRY NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPROXYBANKAREA') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPROXYBANKAREA NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPROXYSWIFTCODE') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPROXYSWIFTCODE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPROXYBANKNAME') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPROXYBANKNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FPROXYBANKADDS') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FPROXYBANKADDS NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FISTRANSPAY') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FISTRANSPAY CHAR(1) DEFAULT '0' NOT NULL );

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