title: Where clause doesn't work in SQL because of space character
body: <pre><code>Select Name from tblAnimal where Id=1
  </code></pre>
  
  <p>Returns: My Pet</p>
  
  <pre><code>Select Id from tblAnimal where Name='My Pet'  --I copy/pasted this value in SSMS!
  </code></pre>
  
  <p>Return empty changeset (WHY?)</p>
  
  <p>After some research I found out that it can be Char(10) and Char(13). So, I guess, when I do copy paste of My Pet, it automatically converts Char(10) to Space for Windows environment?</p>
  
  <p>Because this:</p>
  
  <pre><code>Select id from tblAnimal where Name like '%My%'  
  </code></pre>
  
  <p>returns 1
  While</p>
  
  <pre><code>select id from Animal where Name like '%My %'  
  </code></pre>
  
  <p>returns nothing.</p>
  
  <p>Questions.<br>
  1. Why this is happening?<br>
  2. How to fix this (Production database, several million records)<br>
  3. How to prevent this from happening?  </p>