title: Get column stats in SQL Server 2008
body: <p>I am trying to determine two things in a SQL Server 2008 database. </p>
  
  <p>First, I need to know the columns that have null values in them. </p>
  
  <p>Second, I need to know the count of nulls per column in the actual tables. </p>
  
  <p>I know I can get the first one by doing:</p>
  
  <pre><code>SELECT t.name, c.name 
  FROM sys.tables t 
  INNER JOIN sys.columns c ON t.object_id = c.object_id 
  WHERE c.is_nullable = 1
  </code></pre>
  
  <p>I am struggling to find the second part though.</p>