replace, text datatype

in table1
column1
replace
'\\\\'
with
''

datatype is text, so this does not work

UPDATE table1
SET column1 = REPLACE(column1, '\\\\', '')
WHERE CHARINDEX('\\\\', column1) > 0
LVL 1
rgb192Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
MSSystemsConnect With a Mentor Commented:
Try this
UPDATE table1
SET column1 = REPLACE(cast(column1 as varchar(20)), '\\\\', '')
WHERE CHARINDEX('\\\\', column1) > 0 

Open in new window

0
 
avarmaavarmaCommented:
Try using a LIKE in your where clause

UPDATE table1
SET column1 = REPLACE(column1, '\\\\', '')
WHERE column1 LIKE '%\\\\%'
0
 
MSSystemsCommented:
avarmaavarma:
I the replace function will work against a text data type. I am sure there are other ways, but I think you have to use the UPDATETEXT function for NTEXT Data Types.

0
 
rgb192Author Commented:
0
All Courses

From novice to tech pro — start learning today.