title: Converting from integer to binary and back in SQL Server
body: <p>I've been banging my head against the wall with this one all morning.</p>
  
  <p>The following SQL code and its' result makes no sense to me:</p>
  
  <pre><code>select CONVERT(INT, CONVERT(BINARY(30),2691485888))
  </code></pre>
  
  <p>which results in:</p>
  
  <pre><code>-1060082528
  </code></pre>
  
  <p>What?  Why doesn't the result equal my original integer?</p>
  
  <p>My whole objective is to convert an integer into bytes and store those bytes into the database, but without getting this basic example to work I am stuck.  Can anyone explain what I'm doing wrong?</p>
  
  <p>By the way, I am using Sql Server 2005 (9.0.4340)</p>