title: Search column name having specific value in tables in certain database
body: <p>Is there any way I can search a column having specific value I am trying to find through all tables in a database? 
  For example I have </p>
  
  <pre><code>SELECT t.name AS table_name,
  SCHEMA_NAME(schema_id) AS schema_name,
  c.name AS column_name
  FROM sys.tables AS t
  INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
  WHERE c.name LIKE '%VersionID%'
  ORDER BY schema_name, table_name; 
  </code></pre>
  
  <p>Which I found from searching. It gives me the table names that "versionID" column exists, but how can I search to return table names that for example have a value of "35" for that column. </p>
  
  <p>Thanks in advance,</p>
  
  <hr>
  
  <p>I apologize, maybe I am not being clear in my request. Maybe this cannot be done in SQL because I have not found anything through my research. But let me clarify. </p>
  
  <p>Running this script </p>
  
  <pre><code>SELECT t.name AS table_name,
  SCHEMA_NAME(schema_id) AS schema_name,
  c.name AS column_name
  FROM sys.tables AS t
  INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
  WHERE c.name LIKE '%factor%'
  --and table_name in (Select name from sysobjects where ratingVersionID = 35)
  ORDER BY schema_name, table_name; 
  </code></pre>
  
  <p>Will return this for example:
  <img src="https://i.stack.imgur.com/Q0lHO.jpg" alt="Query Results"></p>
  
  <p>But let say, the "factor" column in "AutoAge_Factor" table does NOT HAVE any records matching to "35". How can I eliminate that table from returning in the results. But I would really prefer the format of the results be this way because I would like to use this return as a loop and do some other stuff within the loop.</p>
  
  <p>Thanks again!</p>