Home All Groups Group Topic Archive Search About
Author
9 Jun 2006 7:07 PM
Logger
I’m trying to key the syntax for replacing the Apostrophe with double
Apostrophe and update table.
Example: Programmer’s with Programmer’’s
Here code for finding occurrences:
SELECT     DEALNAME
FROM DLWKTABLE20060609
where dealname like '%['']%'

BUT how do I update:
Update     dlwktable20060609
Set    dealname = replace(dealname, ???,???)
where dealname like '%['']%'

Author
9 Jun 2006 7:14 PM
SQL Menace
declare @c varchar(50)
select @c ='O''Brian'
select  replace(@c, '''','''''') ,@c


Then the update will be
Update  dlwktable20060609
Set     dealname = replace(dealname, '''','''''')
where dealname like '%['']%'

Denis the SQL Menace
http://sqlservercode.blogspot.com/


Logger wrote:
Show quote
> I'm trying to key the syntax for replacing the Apostrophe with double
> Apostrophe and update table.
> Example: Programmer's with Programmer''s
> Here code for finding occurrences:
> SELECT     DEALNAME
> FROM DLWKTABLE20060609
> where dealname like '%['']%'
>
> BUT how do I update:
> Update     dlwktable20060609
> Set    dealname = replace(dealname, ???,???)
> where dealname like '%['']%'

AddThis Social Bookmark Button