title: Testing for whitespace in SQL Server
body: <p>I've got some blank values in my table, and I can't seem to catch them in an IF statement. </p>
  
  <p>I've tried</p>
  
  <p><code>IF @value = ''</code> and <code>if @value = NULL</code> and neither one catches the blank values. Is there any way to test whether or not a varchar is entirely whitespace?</p>
  
  <p>AHA! Turns out I was testing for null wrong. Thanks. </p>