title: Check if a linked SQL server is running
body: <p>I am writing a stored procedure which runs <code>SELECT</code> queries on several different linked servers using the 4-dot notation.</p>
  
  <p>The problem is, if one of the linked servers is not running, the query fails with error 121 <code>('The semaphore timeout period has expired')</code>.  The other <code>SELECT</code> queries then don't run as this error stops the rest of the query executing.  </p>
  
  <p>I wanted to check <code>@@ERROR</code> then continue running the other queries.</p>
  
  <p>How can I continue running the query if the connection to one of the linked servers fails?</p>
  
  <p>I am using SQL 2012.</p>