TSQL Check Database Instance Online
Posted
by David in Dakota
on Stack Overflow
See other posts from Stack Overflow
or by David in Dakota
Published on 2010-06-16T15:59:06Z
Indexed on
2010/06/16
16:02 UTC
Read the original article
Hit count: 257
sql-server
|tsql
What is the best way to check if an instance of Microsoft SQL Server is up? I have a view that spans two instances of Microsoft SQL Server but before querying it in a stored procedure I would like to verify that the second instance of the server is up with a fallback option of just querying local data.
The second instance is a linked server.
Currently I'm considering a SQL CLR function that can attempt to open a connection with a shorter timeout but I'm wondering if it's something that can be done directly in Transact SQL.
© Stack Overflow or respective owner