title: Using variable in sql WHERE clause for Operation
body: <p>I am not a db admin by any means so if semantics look a bit bizarre, I apologize. 
  In SQL Server, is it possible to use a variable for a comparison operator like so?</p>
  
  <pre><code>declare @compare = '&gt;';
  declare @limit = '5';
  
  select agentId, sessionId, duration
  from table_x
  where duration @compare @limit
  </code></pre>
  
  <p>I do not want to write a ton of lines depending on what the variable could be, which is why I ask. Not to mention if I throw in another variable, that further makes the amount of lines even larger. Also, I like the fact that it's extensible, so in the event there was an additional operator, it would just process it anyway. </p>
  
  <p>Thanks for the help!</p>