title: Bitwise and logic in sql server
body: <p>I have a table that stores flag values in an integer column.(I am not the designer)</p>
  
  <p>I have a query where in one of The where conditions is</p>
  
  <p>flags &amp; 256==0</p>
  
  <p>The above condition is true for all unsigned numbers where the 8th bit is not 1</p>
  
  <p>The question is, in sql server ,while converting the int to  binary,its taking too much time and the performance of query is degraded with lot of other joins.</p>
  
  <p>Is there any way to replace the above condition with a simple consition ?</p>