title: How to determine if database exists on linked server?
body: <p>I know you can do something like: <br/></p>
  
  <p><code>select count(*) as Qty from sys.databases where name like '%mydatabase%'</code></p>
  
  <p>but how could you do something like: <br/></p>
  
  <p><code>select count(*) as Qty from linkedServer.sys.databases where name like '%mydatabases%'</code></p>
  
  <p>I guess I could put a stored procedure on the linked server and execute the first select, but is there a way to query a linked server for what databases it holds?</p>