title: Query SQL Server data dictionary to find all databases containing table 'x'
body: <p>I'm not overly familiar with the SQL Server data dictionary, but I've assumed what I'm trying to do is possible.</p>
  
  <p>We have a number of replicated databases, under different names say:
  Client1
  Client2
  Client3</p>
  
  <p>Rather than rely on a naming convention, I was hoping to identify these databases, based on whether they include a key table, call it MyTable. So started thinking a query such as the following was needed:</p>
  
  <pre><code>SELECT db.name
  FROM sys.databases db
  JOIN sys.tables tbl ON ??
  WHERE tbl.Name = 'MyTable'
  </code></pre>
  
  <p>This doesn't work, as I can't see how to join sys.tables to sys.databases directly or indirectly, and also sys.tables is a view based on the active database, rather than a complete set of tables for all databases.</p>
  
  <p>Can anyone identify a suitable query for this situation?</p>