RE: linked server suffers act of god

RE: linked server suffers act of god

 

  

-- 'Try this linked server, if its there, great do stuff with it, but
if its gone, do nothing and go to the next step."
IF Object_ID('tempdb.dbo.#sp_helpserver') > 0
BEGIN
DROP TABLE #sp_helpserver
END
GO
DECLARE @TargetServer sysname
SET @TargetServer = 'this_linked_server'

CREATE TABLE #sp_helpserver
( [name] sysname -- Server name.
, network_name sysname -- Server's network name.
, status varchar(70) -- Server status.
, id char(4) -- Server's identification number.
, collation_name sysname NULL-- Server's collation.
, connect_timeout int -- Time-out value for connecting to
linked server.
, query_timeout int -- Time-out value for queries against
linked server.
)

INSERT #sp_helpserver
exec sp_helpserver

IF EXISTS (SELECT null FROM #sp_helpserver WHERE name = @TargetServer)
BEGIN
PRINT 'do stuff with it'
END
ELSE
BEGIN
PRINT 'its gone, do nothing and go to the next step.'
END

-----Original Message-----
From: Ligda John
[mailto:mssqldba-ezmlmshield-x88485115.[Email address protected]
Sent: Thursday, November 29, 2007 2:09 PM
To: LazyDBA Discussion
Subject: RE: linked server suffers act of god

I forgot to mention this is server 2000 so no TRY CATCH :(

-----Original Message-----
From: Ligda John
[mailto:mssqldba-ezmlmshield-x60614017.[Email address protected]
Sent: Thursday, November 29, 2007 2:06 PM
To: LazyDBA Discussion
Subject: linked server suffers act of god

Hi,



Im looking for procedure logic that says; 'Try this linked server, if
its there, great do stuff with it, but if its gone, do nothing and go to
the next step."



How do I trap an error message for a linked server call when the linked
server blows up?



John


--
DISCLAIMER

Confidentiality Note: This e-mail is intended only for the person or
entity to which it is addressed and may contain information that is
privileged, confidential or otherwise protected from disclosure.
Dissemination, distribution or copying of this e-mail or the information
herein by anyone other than the intended recipient, or an employee or
agent responsible for delivering the message to the intended recipient,
is prohibited. If you have received this e-mail in error, please notify
us immediately (telephone
415-288-0544 or e-mail [Email address protected] and destroy the
original message and all copies.

Hall Capital Partners LLC reserves the right to monitor and review the
content of all e-mail communications sent and/or received by its
employees.



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



--
DISCLAIMER

Confidentiality Note: This e-mail is intended only for the person or
entity to which it is addressed and may contain information that is
privileged, confidential or otherwise protected from disclosure.
Dissemination, distribution or copying of this e-mail or the information
herein by anyone other than the intended recipient, or an employee or
agent responsible for delivering the message to the intended recipient,
is prohibited. If you have received this e-mail in error, please notify
us immediately (telephone
415-288-0544 or e-mail [Email address protected] and destroy the
original message and all copies.

Hall Capital Partners LLC reserves the right to monitor and review the
content of all e-mail communications sent and/or received by its
employees.



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


MS Sql Server LazyDBA home page