title: Filtering unicode column in Sql server 2005 - to much data match
body: <p>I have a simple table:</p>
  
  <pre><code>CREATE TABLE [dbo].[Users]([Surname] [nvarchar](50) COLLATE Latin1_General_CI_AI NULL) ON [PRIMARY]
  </code></pre>
  
  <p>with two rows:</p>
  
  <pre><code>Paweł
  Pawel
  </code></pre>
  
  <p>Issuing following select statement:</p>
  
  <pre><code>SELECT *, CAST(Surname AS VARBINARY(30)) AS Expr1, CAST(N'Paweł' AS VARBINARY(30)) AS Expr1 
  FROM Users WHERE Surname = N'Paweł'
  </code></pre>
  
  <p>gives following result:</p>
  
  <pre><code>Paweł   0x50006100770065004201  0x50006100770065004201
  Pawel   0x50006100770065006C00  0x50006100770065004201
  </code></pre>
  
  <p>Row with value 'Pawel' is returned , even though it's not equal to 'Paweł' (binary columns show it).</p>
  
  <p>Any idea what is going on, how come SQL server considers Pawel = Paweł in that case?</p>
  
  <p>Thanks, Paweł</p>