title: How To Compare Image Data Types In SQL Server
body: <p>I'm having a lot of trouble writing a select statement to compare two values in t-sql which are of type image.  This is what I have so far:</p>
  
  <pre><code>SELECT a.UserId, b.UserId
  FROM [dbo].[aspnet_Profile] as a inner join [dbo].[aspnet_Profile] as b on
      (a.UserId = &lt;some string&gt; AND b.UserId = &lt;some other string&gt;)
  WHERE BINARY_CHECKSUM(a.PropertyValuesBinary) = BINARY_CHECKSUM(b.PropertyValuesBinary)
  </code></pre>
  
  <p>But I keep getting error messages no matter what I do to the WHERE clause.  For the above query, the error message I get is: </p>
  
  <blockquote>
    <p>Error in binarychecksum. There are no
    comparable columns in the
    binarychecksum input.</p>
  </blockquote>
  
  <p>At any rate, any help would be very much appreciated.  I'm have a very hard time doing anything with this data-type, for some reason...</p>
  
  <p>BTW:  I'm using SQL Server Web (I think it's the 2008 edition)...</p>
  
  <p>Thanks!</p>
  
  <p>Andrew</p>