Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2008-06-04 : 01:12:24
|
| Can i any one help regd error handling while executing stored procedure.Sample Sequence of execution :CREATE procedure RBI_Control_spasbeginset nocount onbegin try BEGIN TRANSACTION --Truncating the Table in ramcovm392(fin_ods) exec fin_ods..trun_sp --Data Transfer From the Live Server to Dw-Server exec fin_ods..RBI_Data_Transfer_sp insert into fin_wh..Status_report([object_name],row,[date]) select 'Data Tranfer','SUCCESS',getdate() COMMIT TRANSACTIONend trybegin catch<b> [i need to insert the type of error in status report table]</b> rollback transaction insert into fin_wh..Status_report([object_name],row,[date]) select 'Data Tranfer','FAILURE',getdate()end catchset nocount offend |
|
|
sachinsamuel
Constraint Violating Yak Guru
383 Posts |
Posted - 2008-06-04 : 05:16:09
|
| Below are the functions which you can use get the error details.ERROR_NUMBER() ERROR_SEVERITY() ERROR_STATE() ERROR_PROCEDURE() ERROR_LINE() ERROR_MESSAGE() Please check the below URL for more information.http://www.sqlservercentral.com/articles/News/exceptionhandlinginsqlserver2005/2237/regardsSachinDon't sit back because of failure. It will come back to check if you still available. -- Binu |
 |
|
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2008-06-05 : 01:37:44
|
Txs sachinsamuel.i got it.quote: Originally posted by sachinsamuel Below are the functions which you can use get the error details.ERROR_NUMBER() ERROR_SEVERITY() ERROR_STATE() ERROR_PROCEDURE() ERROR_LINE() ERROR_MESSAGE() Please check the below URL for more information.http://www.sqlservercentral.com/articles/News/exceptionhandlinginsqlserver2005/2237/regardsSachinDon't sit back because of failure. It will come back to check if you still available. -- Binu
|
 |
|
|
|
|
|