title: How to replace ' from the select query
body: <p>In SQL Server, I have this query</p>
  
  <pre><code>SELECT DISTINCT  City FROM 
  Person.Address
  </code></pre>
  
  <p>But this gives me two cities which has name like Ville De'anjou (i.e. <strong>'</strong>)</p>
  
  <p>you can try the same by this </p>
  
  <pre><code>SELECT DISTINCT  City FROM 
  Person.Address
  WHERE City like '%''%'
  </code></pre>
  
  <p>Now, I am creating a SSIS package which is creating folder for each city. But the package fails at these two cities and throw this error</p>
  
  <pre><code>[ADO NET Source [1]] Error: An error occurred executing the provided SQL command: "SELECT AddressID, AddressLine1,PostalCode, City
   FROM Person.Address WITH(NOLOCK)
   WHERE City = 'Ville De'anjou'". Incorrect syntax near 'anjou'.
  Unclosed quotation mark after the character string ' SET FMTONLY OFF;'.
  </code></pre>
  
  <p>It fails because this isn't a correct query.</p>
  
  <p>I have tried with this but no luck, instead it removed those two cities from the list</p>
  
  <pre><code>SELECT DISTINCT CITY FROM Person.Address
  WHERE City like REPLACE(City,'''', '''''')
  </code></pre>
  
  <p>How can I rectify this error?</p>