/**Begin D:\PDM_UPGRADE\PDM1\BEI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_UPDATEPAYSTAT_ENTRY' AND KSQL_COL_NAME IN ('FSOURCEBILLNO'))
 ALTER TABLE T_BEI_UPDATEPAYSTAT_ENTRY ADD (FSOURCEBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_UPDATEPAYSTAT_ENTRY' AND KSQL_COL_NAME IN ('FSOURCEBILLID'))
 ALTER TABLE T_BEI_UPDATEPAYSTAT_ENTRY ADD (FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_UPDATEPAYSTAT_ENTRY' AND KSQL_COL_NAME IN ('FSUPERSRCBILLID'))
 ALTER TABLE T_BEI_UPDATEPAYSTAT_ENTRY ADD (FSUPERSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_UPDATEPAYSTAT_ENTRY' AND KSQL_COL_NAME IN ('FSUPERSRCTYPE'))
 ALTER TABLE T_BEI_UPDATEPAYSTAT_ENTRY ADD (FSUPERSRCTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_UPDATEPAYSTAT_ENTRY' AND KSQL_COL_NAME IN ('FISENCRYPTION'))
 ALTER TABLE T_BEI_UPDATEPAYSTAT_ENTRY ADD (FISENCRYPTION CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_UPDATEPAYSTAT_ENTRY' AND KSQL_COL_NAME IN ('FCURRENCYID'))
 ALTER TABLE T_BEI_UPDATEPAYSTAT_ENTRY ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\BEI_table.sql **/
