title: T-SQL trim &nbsp (and other non-alphanumeric characters)
body: <p>We have some input data that sometimes appears with &amp;nbsp characters on the end.</p>
  
  <p>The data comes in from the source system as varchar() and our attempts to cast as decimal fail b/c of these characters.</p>
  
  <p>Ltrim and Rtrim don't remove the characters, so we're forced to do something like:</p>
  
  <pre><code>UPDATE myTable
  SET myColumn = replace(myColumn,char(160),'')
  WHERE charindex(char(160),myColumn) &gt; 0
  </code></pre>
  
  <p>This works for the &amp;nbsp, but is there a good way to do this for any non-alphanumeric (or in this case numeric) characters?</p>