Below is the sample table. Would like to get record as matching,but not getting with below tried query.
mytable
ID cat_name
100 Bathroom sinks
declare @key varchar(50) ='bathroom sink'
select * from mytable where cat_name like '%@key%'
Below is the sample table. Would like to get record as matching,but not getting with below tried query.
mytable
ID cat_name
100 Bathroom sinks
declare @key varchar(50) ='bathroom sink'
select * from mytable where cat_name like '%@key%'
What is the collation on the table/database?
select * from mytable where cat_name like '%' + @key + '%'