title: Escape double quotes in SQL 2005/2008
body: <p>I have an international company that has recently been added, which is named "BLA "BLAHBLAH" Ltd. (The double quotes are part of the name. )</p>
  
  <p>Whenever a user tries to search for this company, by entering "Blah, or something to that affect, the search fails with a syntax error in SQL server.</p>
  
  <p>How can I escape this so the search will not fail?</p>
  
  <p>Sample SQL:</p>
  
  <pre><code>SELECT c.companyID, c.companyName, c.dateAdded, count(cm.maxID) as NumDirect
      FROM RussoundGeneral.dbo.Company c  
           LEFT JOIN RussoundGeneral.dbo.CompanyMax cm
                  ON (cm.companyId = c.companyId and cm.maxID is not null)  
      WHERE CONTAINS ( companyName,  '"BLAH*' )
      GROUP BY c.companyID, c.companyName, c.dateAdded  
      ORDER BY c.companyName ASC
  </code></pre>