/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGINFOENTRY' AND KSQL_COL_NAME IN ('FBEIBANKDETAILNO')) 
 ALTER TABLE T_CAS_RECEIVINGINFOENTRY ADD (FBEIBANKDETAILNO NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDETAILID')) 
 ALTER TABLE T_CAS_PAYBANKCHECKFLAG ADD (FEDETAILID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEBIZDATE')) 
 ALTER TABLE T_CAS_PAYBANKCHECKFLAG ADD (FEBIZDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDETAILBILLNO')) 
 ALTER TABLE T_CAS_PAYBANKCHECKFLAG ADD (FEDETAILBILLNO NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FECURRENCYID')) 
 ALTER TABLE T_CAS_PAYBANKCHECKFLAG ADD (FECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDEBITAMOUNT')) 
 ALTER TABLE T_CAS_PAYBANKCHECKFLAG ADD (FEDEBITAMOUNT DECIMAL(19,6) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FECREDITAMOUNT')) 
 ALTER TABLE T_CAS_PAYBANKCHECKFLAG ADD (FECREDITAMOUNT DECIMAL(19,6) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDETAILID')) 
 ALTER TABLE T_CAS_RECBANKCHECKFLAG ADD (FEDETAILID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEBIZDATE')) 
 ALTER TABLE T_CAS_RECBANKCHECKFLAG ADD (FEBIZDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDETAILBILLNO')) 
 ALTER TABLE T_CAS_RECBANKCHECKFLAG ADD (FEDETAILBILLNO NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FECURRENCYID')) 
 ALTER TABLE T_CAS_RECBANKCHECKFLAG ADD (FECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDEBITAMOUNT')) 
 ALTER TABLE T_CAS_RECBANKCHECKFLAG ADD (FEDEBITAMOUNT DECIMAL(19,6) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FECREDITAMOUNT')) 
 ALTER TABLE T_CAS_RECBANKCHECKFLAG ADD (FECREDITAMOUNT DECIMAL(19,6) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDETAILID')) 
 ALTER TABLE T_CAS_AGENTBANKCHECKFLAG ADD (FEDETAILID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEBIZDATE')) 
 ALTER TABLE T_CAS_AGENTBANKCHECKFLAG ADD (FEBIZDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDETAILBILLNO')) 
 ALTER TABLE T_CAS_AGENTBANKCHECKFLAG ADD (FEDETAILBILLNO NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FECURRENCYID')) 
 ALTER TABLE T_CAS_AGENTBANKCHECKFLAG ADD (FECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FEDEBITAMOUNT')) 
 ALTER TABLE T_CAS_AGENTBANKCHECKFLAG ADD (FEDEBITAMOUNT DECIMAL(19,6) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTBANKCHECKFLAG' AND KSQL_COL_NAME IN ('FECREDITAMOUNT')) 
 ALTER TABLE T_CAS_AGENTBANKCHECKFLAG ADD (FECREDITAMOUNT DECIMAL(19,6) );

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