title: How to use REPLACE with string containing apostrophe?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1440733/replace-single-quote-in-sql-server">Replace single quote in sql server</a>  </p>
  </blockquote>
  
  
  
  <p>So I'm trying to use the following code:</p>
  
  <pre><code>UPDATE TableName
  SET FieldName = REPLACE(FieldName, 'SearchFor', 'ReplaceWith');
  </code></pre>
  
  <p>It works wonderfully for what I need to do, except for the fact that what I need to search for is "valid driver's license". That apostrophe doesn't seem to agree with the code. I tried doing this:</p>
  
  <pre><code>'valid driver''s license'
  </code></pre>
  
  <p>...but that doesn't seem to work either. I'm getting the following error:</p>
  
  <pre><code>Argument data type text is invalid for argument 1 of replace function.
  </code></pre>
  
  <p>If anyone has dealt with this before, I would love some help! This would save me so much time, rather than updating each record by hand. -__-</p>
  
  <p>Ellie</p>