title: Keeping string only after last character for full table update
body: <p>I want to do an SQL update and remove any characters before and including "\".</p>
  
  <p>I found SQL Reverse and looked at code from <a href="https://stackoverflow.com/questions/30752258/remove-substring-before-last-occurrence-of-a-special-character-in-sql-server/30752314#30752314">another question</a> which suggests </p>
  
  <pre><code>SELECT RIGHT(@str, CHARINDEX('.', REVERSE(@str)) - 1)
  </code></pre>
  
  <p>or </p>
  
  <pre><code>SELECT RIGHT(@str, CHARINDEX('\', '\' + REVERSE(@str)) - 1)
  </code></pre>
  
  <p>Is the modification below the best way to do update on a SQL table:</p>
  
  <pre><code>UPDATE [DB].dbo._tbldata 
  SET DOCURL =  RIGHT(DOCURL, CHARINDEX('\',  REVERSE('\' + DOCURL)) - 1)
  </code></pre>
  
  <p>and should I add </p>
  
  <pre><code>WHERE DOCURL LIKE '%\%'
  </code></pre>