title: In TSQL, how to evaluate an expression and assign it to a BIT field?
body: <p>I'm struggling on something very simple. I'm trying to assign the results of a boolean expression to a <code>BIT</code> variable.</p>
  
  <p>Basically I would like to do something like:  </p>
  
  <pre><code>DECLARE @is_search_term_empty BIT
  
  SET @is_search_term_empty = (@search_term = '')
  </code></pre>
  
  <p>where <code>@search_term</code> is a <code>NVARCHAR(128)</code> declared somewhere else in the code.</p>
  
  <p>I cannot work out the syntax to evaluate something and assign it to a <code>BIT</code> variable, ie:</p>
  
  <pre><code>SET @is_search_term_empty = (1 &gt; 2) 
  </code></pre>
  
  <p>Thanks.</p>