SQLTeam.com | Weblogs | Forums

Update table content in common


Have a table structure like this
id title pagelink

1 t1 <mydomain.com>/t1
2 t2 <mydomain.com>/t2
3 t3 <mydomain.com>/t3

Want to update the link column with domain change as 'mydomain.com' to' mydomain.net'

Is it possible to change in a common way rather than execute an update statement individually for each row?

Thanks in advance

Something along these lines:

UPDATE dbo.table_name
SET pagelink = REPLACE(pagelink, '<mydomain.com', '<mydomain.net')
WHERE pagelink LIKE '%<mydomain.com%'