title: sql search query for multiple optional parameters
body: <p>I'm trying to write a query for an advanced search page on my document archiving system.  I'm attempting to search by multiple optional parameters.  I have about 5 parameters that could be empty strings or search strings.  I know I shouldn't have to check for each as a string or empty and create a separate stored procedure for each combination.</p>
  
  <p>Edit:
  Ended up using:</p>
  
  <pre><code>ISNULL(COALESCE(@var, a.col), '') = ISNULL(a.col, '')
  </code></pre>