Assuming you are on MSSQL, try
SQL Fiddle
Setting up the MS SQL Server 2008 schema :
create table t ( id int not null identity(1, 1), category varchar(max) ) create table map ( col1 varchar(max), col2 varchar(max) ) insert t (category) values ('jack, gill, tommy, jill, jacky, paul, Johnny, be, good, tammy, sammy, john'), ('jack, gill, tommy, jill, jacky, paul, Johnny, be, good'), ('Johnny, be, good, tammy, sammy, john') insert map (col1, col2) values ('Johnny, be, good', 'johnny be good')
Request 1 :
update t set category = replace(category, m.col1, m.col2) from t join map m on t.category like m.col1 + '%'
Results :
| ID | CATEGORY | --------------------------------------------------------------------------------- | 1 | jack, gill, tommy, jill, jacky, paul, johnny be good, tammy, sammy, john | | 2 | jack, gill, tommy, jill, jacky, paul, johnny be good | | 3 | johnny be good, tammy, sammy, john |