I will try something like this:UPDATE #t1 SET f5 = CASE WHEN F4 LIKE '%'+F2+'%' THEN 1 ELSE 0 END
my test:IF OBJECT_ID('tempDB..#t1') IS NOT NULLBEGIN DROP TABLE tempDB..#t1ENDCREATE TABLE #t1( f1 INT, f2 VARCHAR(100), f3 VARCHAR(100), f4 VARCHAR(100), f5 TINYINT)INSERT INTO #t1 (f1,f2,f3,f4)SELECT 1,'test','field3','xxstestsss'UNION ALLSELECT 2,'tezt','field3','xxxtez'UNION ALLSELECT 3,'something','field3','field4'UPDATE #t1 SET f5 = CASE WHEN F4 LIKE '%'+F2+'%' THEN 1 ELSE 0 ENDSELECT * FROM #t1DROP TABLE tempDB..#t1
sabinWeb MCP