var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Exception handling on linked server
I am trying to handle exceptions using try catch with remote database.
I am writing the following code which works fine if login locally but when I am trying to do the same on linked server its not being caught in try..catch block. Can anyone help me.
The procedure I am writing to raiserror
create proc CustomError
RAISERROR ('db error', 16, 1);
I am calling the above procedure in local database using following code
select ERROR_MESSAGE() as ERROR_MESSAGE;
and it works perfectly. I am able to catch the error in catch block.
and i m getting the following result
but when i am trying to do the same on linked server the code doesn't take me to catch block. I am getting following error while executing the code
where [192.168.0.50] is a linked server name and BM is the database name and custom error is my sp which is on remote server.
its giving me following error
Msg 50000, Level 16, State 1, Procedure CustomError, Line 11
can anyone help me on this.
Last edited by shirazm; 03-09-09 at 04:38.
exception handling on linkserver
I think this will work: