/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY' AND KSQL_COL_NAME IN ('FPAYMENTTERM')) 
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY ADD (FPAYMENTTERM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY' AND KSQL_COL_NAME IN ('FPAYMENTFPS')) 
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY ADD (FPAYMENTFPS NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY' AND KSQL_COL_NAME IN ('FPAYMENTAREACODE')) 
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY ADD (FPAYMENTAREACODE NVARCHAR(3) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY' AND KSQL_COL_NAME IN ('FENTRYMOBILE')) 
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY ADD (FENTRYMOBILE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY' AND KSQL_COL_NAME IN ('FINFORPAYMENT')) 
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY ADD (FINFORPAYMENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY' AND KSQL_COL_NAME IN ('FINFORMRECEMAIL')) 
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY ADD (FINFORMRECEMAIL NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_C' AND KSQL_COL_NAME IN ('FPAYMENTTERM')) 
 ALTER TABLE T_CAS_PAYMENTBILL_C ADD (FPAYMENTTERM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_C' AND KSQL_COL_NAME IN ('FPAYMENTFPS')) 
 ALTER TABLE T_CAS_PAYMENTBILL_C ADD (FPAYMENTFPS NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_C' AND KSQL_COL_NAME IN ('FPAYMENTAREACODE')) 
 ALTER TABLE T_CAS_PAYMENTBILL_C ADD (FPAYMENTAREACODE NVARCHAR(3) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_C' AND KSQL_COL_NAME IN ('FINFORPAYMENT')) 
 ALTER TABLE T_CAS_PAYMENTBILL_C ADD (FINFORPAYMENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_C' AND KSQL_COL_NAME IN ('FINFORMRECEMAIL')) 
 ALTER TABLE T_CAS_PAYMENTBILL_C ADD (FINFORMRECEMAIL NVARCHAR(255) DEFAULT ' ' NOT NULL );

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