Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

how to test connectivity for a linked server Expand / Collapse
Author
Message
Posted Saturday, September 22, 2007 1:05 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, July 17, 2014 6:57 AM
Points: 55, Visits: 159
Comments posted to this topic are about the item how to test connectivity for a linked server
Post #401451
Posted Monday, October 29, 2007 6:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 8:27 AM
Points: 6, Visits: 31
why not just use:
DECLARE @TEST BIT
EXEC @test = SP_TESTLINKEDSERVER [mylinkedservername]

IF @test = 0
BEGIN
PRINT 'test failed'
END
else
BEGIN
PRINT 'test succeeded'
END
Post #415993
Posted Friday, September 16, 2011 12:39 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, August 28, 2014 1:16 PM
Points: 316, Visits: 812
I agree, sort of. In tests on SQL 2005, seems to me the proc call needs to be in TRY/CATCH else control does not flow down to the PRINT stmts when linked server is not available. But I have not been able to simulate this problem on SQL 2008 R2. Maybe MS have implemented TRY/CATCH internally.

Thanks to the author, though, for bringing light to SP_TESTLINKEDSERVER, it's new for me.



Post #1176599
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse