/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_BANKETPPWD') 
 CREATE TABLE T_CAS_BANKETPPWD (
FID BIGINT DEFAULT 0 NOT NULL,
FUSER BIGINT DEFAULT 0 NOT NULL,
FPASSWORD NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL
);


 EXEC p_AlterColumn 'T_CAS_AGENTPAYBILL', 'FBANKCHECKFLAG', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_PAYMENTBILL', 'FBANKCHECKFLAG', 'VARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME ='FSELLINGBANKCHECKFLAG') 
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FSELLINGBANKCHECKFLAG NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME ='FFEEBANKCHECKFLAG') 
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FFEEBANKCHECKFLAG NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME ='FBUYBANKCHECKFLAG') 
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FBUYBANKCHECKFLAG NVARCHAR(255) DEFAULT ' ' NOT NULL );

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