Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the scope of RAISEERROR? Getting error details on a remote server?

Status
Not open for further replies.

RRinTetons

IS-IT--Management
Jul 4, 2001
333
US
I have a stored procedure on one server and an sp that calls it on another one (separate physical servers, instancces, etc.) The sp that is called does a bunch of validation and on failure uses RAISEERROR to pass info to the calling environment. It works fine in the actual db where the called sp lives, and from another db on the same server in the same instance. When it's called from the other server, however, the information supplied by RAISEERROR appears in the SSMS results pane, but is NOT available with the usual selects. The called sp uses RETURN to send back the value of @@ERROR, and that is available on the calling server, but not the rest of the error info.

Is this a limitation of SQL Server 2008? It seems like it could be, the error info is probably local to the environment where the error occurred, but I'm hoping there's some means to get at it. Maybe a configuration option? Unfortunately, the sp called that raises the error is vendor-supplied code and I can't modify it.

-
Richard Ray
DBA, Developer, Data Analyst
Jackson Hole Mountain Resort
 
The good news is that I've got an answer. The bad news is that the answer is that it doesn't work. As I suspected, and as per Microsoft, the error on the remote server cannot be caught in a CATCH block on the calling server, it just doesn't work that way, and there's no workaround.

Bummer, but at least I can stop trying to figure it out!

-
Richard Ray
DBA, Developer, Data Analyst
Jackson Hole Mountain Resort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top