How to find and replace double quotes?

Apr 6 2010 4:42 PM

Hi All,
Here's my dilemma.  I am trying to create a data cleansing app that looks at a single column in a Sybase db and replaces double quotes " with a space. 
Here is my current code (which obviously isn't working).
Any ideas?
Many thanks.
---------------
string
strSql = string.Empty;
string find = """;
string replace = " ";
strSql =
"DECLARE @patfind varchar(255)"
+
"UPDATE my_table SET my_column = ltrim(rtrim(STUFF( my_column,PATINDEX( '"+find+"', my_column),"
+
"DATALENGTH( '" + find + "' ),'" + replace + "' ))) WHERE email LIKE '" + find + "' ";

Answers (3)