title: Shorthand IF statements in sql
body: <p>Currently I have a stored proc, which takes a string</p>
  
  <pre><code>@vari as varchar(30)
  if @vari is null 
      SELECT * FROM TABLE 
  else 
      SELECT * FROM TABLE WHERE col = @vari
  endif
  </code></pre>
  
  <p>is there any way to inline the if statement, thereby not declaring 2 select's just because of 1 param?</p>