title: Get distinct values from each table and each column with SQL Server
body: <p>I would like to loop through each table for a given database to get unique values for each char field.</p>
  
  <p>My query might something like:</p>
  
  <pre><code>for each table:
      for each row in table:
         select distinct char_field
         from table
      loop
  loop
  </code></pre>
  
  <p>How do I do this?</p>