First thanks for your help.
I just started working with tsql and I got a problem with performance.
I have two tables table1 and table2, table2 give me a lot f patterns that I got check if I find in each row of table1, if it happen I save to another column in table1.
So I get this string transform into a regexp and use "Like" expression like this
UPDATE table1 AS tb1
SET CASE
WHEN tb1.ft IS NOT NULL tb1.ft = tb1.ft + ',' +tb2.[as]
ELSE tb1.ft = tb2.[as]
FROM table1,
INNER JOIN (
SELECT DISTINCT [as]
FROM table2
) AS tb2
ON fn like '%' +tb2.[as]+'%' OR fp like '%' +tb2.[as]+'%'
Do you guys think there is a way to improve performance? I Kind of got stuck in this solution
p.s: I didn't tested the update, only a select.