Very occasionally we lose our internet connection, which means our
linked server isn't accessible.
I need to create a stored procedure that does an update on both servers
at the same time. I want this to be aware of the linked server not being
accessible, do the local part of the update, but also mark it so that
when the link is back up, the remote part of the update can be carried out.
Is this at all possible? Can the status of a linked server be obtained?
The SQL user won't have loads of privileges. It can run stored
procedures on the linked server, but its not a sys admin, not sure if
that matters or not.
Any advice is welcome.
Cheers,
Dooza
Ping the server
SET NOCOUNT ON
CREATE TABLE #t_ip (ip varchar(255))
DECLARE @PingSql varchar(1000)
SELECT @PingSql = 'ping ' + '10.10.5.2'
INSERT INTO #t_ip EXEC master.dbo.xp_cmdshell @PingSql
SELECT * FROM #t_ip
IF EXISTS (SELECT TOP 2 * FROM #t_ip WHERE IP = 'Request timed out' )
BEGIN
DROP TABLE #t_ip
RETURN
END
DROP TABLE #t_ip
"Dooza" <ste...@SPAM.dooza.tv> wrote in message
news:uDphaxPb...@TK2MSFTNGP05.phx.gbl...
Hi Uri,
This looks good, I take it I can put it in a stored procedure and just
call that from stored procedures that use the linked servers?
Steve
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Dooza" <ste...@SPAM.dooza.tv> wrote in message
news:uDphaxPb...@TK2MSFTNGP05.phx.gbl...