/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_table.sql **/
 EXEC p_AlterColumn 'T_CAS_BANKJOURNAL', 'FSOURCEBILLNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_BANKJOURNAL', 'FSETTLEMENTNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_BANKJOURNAL', 'FBANKCHECKFLAG', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FBIZOBJECT', 'VARCHAR(50)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FBANKCHECKFLAG', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FSETTLEMENTNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FVOUCHERNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FOPPACCTNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FSOURCEBILLNUMBER', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FTRADENUMBER', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CHECKEDRESULTENTRY', 'FBANKVOUVHERNO', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_BANKSTATEMENT', 'FBANKVOUCHERNO', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_BANKSTATEMENT', 'FVOUCHERNUMBER', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_BANKSTATEMENT', 'FBANKCHECKFLAG', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECBILLCHANG_E' AND KSQL_COL_NAME ='FINNERACCOUNTID') 
 ALTER TABLE T_CAS_RECBILLCHANG_E ADD (FINNERACCOUNTID BIGINT DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_CAS_PAYMENTBILLENTRY', 'FREMARK', 'NVARCHAR(512)', 'NULL', '0100', '';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILLENTRY' AND KSQL_COL_NAME ='FEFREEZEAMT') 
 ALTER TABLE T_CAS_PAYMENTBILLENTRY ADD (FEFREEZEAMT DECIMAL(19,6) DEFAULT 0 NOT NULL );

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