/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILLENTRY' AND KSQL_COL_NAME IN ('FCOREBILLID')) 
 ALTER TABLE T_CAS_RECEIVINGBILLENTRY ADD (FCOREBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_CAS_CLAIMBILL_L', 'FPKID', 'VARCHAR(18)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CLAIMNOTICEBILL_L', 'FPKID', 'VARCHAR(18)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_CAS_RECWARNRESULT', 'FSTATUS', 'CHAR(1)', 'NOT NULL', '0010', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE_E' AND KSQL_COL_NAME IN ('FNOTIFISCHE')) 
 ALTER TABLE T_CAS_RECPAYRULE_E ADD (FNOTIFISCHE NVARCHAR(1024) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_CLAIMBILL' AND KSQL_COL_NAME IN ('FPAYMENTEE')) 
 ALTER TABLE T_CAS_CLAIMBILL ADD (FPAYMENTEE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_CLAIMDETAILENTRY' AND KSQL_COL_NAME IN ('FCOREBILLID')) 
 ALTER TABLE T_CAS_CLAIMDETAILENTRY ADD (FCOREBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_CAS_CLAIMNOTICEBILL', 'FCLAIMUSERS', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CLAIMNOTICEBILL', 'FJOINCLAIM', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CLAIMNOTICEBILL', 'FJOINUNIT', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CLAIMNOTICEBILL', 'FJOINRULE', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CAS_CLAIMNOTICEBILL', 'FCLAIMME', 'CHAR(1)', 'NOT NULL', '0001', '''0''';

 EXEC p_AlterColumn 'T_CAS_CLAIMNOTICEBILL_E', 'FHANDLESTATUS', 'CHAR(1)', 'NOT NULL', '0001', '''0''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_CLAIMNOTICEBILL_E' AND KSQL_COL_NAME IN ('FCOREBILLID')) 
 ALTER TABLE T_CAS_CLAIMNOTICEBILL_E ADD (FCOREBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_CAS_CLAIMTYPE_E', 'FCLAIMTYPE', 'CHAR(1)', 'NOT NULL', '0001', '''0''';


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