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.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Logging the name of a linked server that errors

Author  Topic 

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-09-01 : 11:18:34
Hi,

If a linked server produces an error, is there any way of logging the name of the linked server that errored?

Example:
I have server A, that has 3 linked servers B,C and D.

I have an application that connects to server A and talks to B,C and D via A.

Lets say that for some reason A cannot connect to D, and an error appears as a result of that. I need to pass the name of that offending linked server, D, to the application so that the user knows which of A,B or C errored.

Any ideas?

Thanks

Drew

Thanks

Drew

Kristen
Test

22859 Posts

Posted - 2006-09-01 : 17:00:23
In an Sproc, on ServerA where it is known that it needs to talk to, say, ServerB and ServerC you would perhaps make dummy SELECTs on the remote servers to check that they are there, and live.

But that would, presumably, take 2 or 3 minutes to timeout f the servers were actually down, and IME would yield a cascade of irrelevant error messages (within which the relevant error messages were buried).

Over the last 5 years the resilience of the networks we use has increased so dramatically that "off line" is an error message that is very VERY rare. Probably no help, but maybe putting the available Resource effort into improving the resilience of the network would be a better investment than the error-coding against scenarios where the network is down (but, presumably, the ability to test the code for such scenarios is difficult / expensive / hard to devise and prove adequately)

Kristen
Go to Top of Page

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-09-06 : 03:47:52
IME?

Thanks

Drew
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2006-09-06 : 12:56:40
quote:
Originally posted by drewsalem

IME?

Thanks

Drew



In My Experience

Ken
Go to Top of Page

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-09-07 : 08:53:46
I thought IME was some kind of console or log. Oh well.

quote:
and IME would yield a cascade of irrelevant error messages (within which the relevant error messages were buried).


But this is what I am saying though, that there are no error messages for linked servers that specify the Linked Server name.

Lets say in EM you expand your long list of Linked Servers, and then you click on one of them Linked Servers, and it comes back with say the following message:

Server: Msg 17, Level 16, State 1, Line 1 
SQL Server does not exist or access denied


Notice the error says SQL Server does not exit. It does not give the name of the linked server. I need the name of the linked server so that I can automate further action. But the name of the server is not passed on or logged anywhere (as far as I am aware, hence my post).

In addition to this, you cannot trap these errors using @@error.

SQL Server 2005 is far more friendlier with messages such as:

OLE DB provider "SQLNCLI" for linked server "linked_server_name" returned message "Login timeout expired".



Thanks

Drew
Go to Top of Page
   

- Advertisement -