title: SSIS step needed to count number of rows and error if zero
body: <p>I need to check if a table has been populated before proceeding in an SSIS package (SQL2008 R2).</p>
  
  <p>My thoughts were to add an Execute SQL task, and use a CASE statement, but it's not the correct format.</p>
  
  <pre><code>CASE
  WHEN (SELECT COUNT(*) FROM STAGING.dbo.tableX) &lt;1
      THEN RaisError('NO ROWS',18,1)
  ELSE 
  END AS X
  </code></pre>
  
  <p>This should be easy, but I am stymied.
  Thanks</p>