title: fixing bad characters in SQL?
body: <p>I've got a database that was migrated from Oracle to SQL Server. One of the tables has data like:</p>
  
  <pre><code>Name
  steve
  mark
  john
  matt
  </code></pre>
  
  <p>when I do this query:</p>
  
  <pre><code>select * from [TABLE] where Name = 'steve'
  </code></pre>
  
  <p>nothing is returned. If I use SSMS and edit the column by nulling it out and then retyping the data, the query works. So, something is in that character string as a result of the migration that isn't displayed. </p>
  
  <p>Is there any way I can display the more "raw" data of the column so I can try to figure out what this bad data is?</p>
  
  <p>Thanks</p>
  
  <p>UPDATE:</p>
  
  <p>I changed my query a bit and found something interesting:</p>
  
  <pre><code>SELECT LEN(RTRIM(Name)) from [Table]
  </code></pre>
  
  <p>and what I got was lengths that were longer than 5,4,4,4... so there are certainly some characters after the names but they aren't whitespaces. </p>
  
  <p>Unfortunately I have some values like:</p>
  
  <pre><code>steve
  steve1
  steve12
  </code></pre>
  
  <p>so I can't simple go </p>
  
  <pre><code>where NAME like 'steve%' 
  </code></pre>
  
  <p>as it would incorrectly grab all three rows.</p>
  
  <p>UPDATE (SOLUTION):</p>
  
  <p>Yup, it was some char(13) + 10's.. I used the generate scripts task in SSMS to generate some inserts and it showed some newlines. I just did an UPDATE with REPLACE and all is well. Thanks everybody!</p>