title: Conditional filter in WHERE clause
body: <p>How can I set a conditional filter in a SQL WHERE clause?  For example, I have a parameter @ID with the following procedure</p>
  
  <pre><code>SELECT * FROM myTable WHERE Column1 = 'test' AND Column2 = @ID
  </code></pre>
  
  <p>However, If @ID = -1 I don't want the last part of the SQL (AND Column2 = @ID) included</p>
  
  <p>I realize I can make an if statement with 2 separate queries, however this is a large script and has this same issue multiple times, so I was hoping there was a better way than nearly duplicating several queries</p>