You are doing a lot of unnecessary work in that query.
...like '%' + @word + '%'...already covers "starts with" and "ends with" criteria, so you' don't need a lot of those conditions.
↧