I have a small problem in retrieving characters using user variable in SQL
The query is as follows
DECLARE @search
SET @search='chicken'
SELECT * from Recipes where TITLE like '@search'
IS this correct? It should retrieve the recipes where Title contains the word which is given to @search.
I even tried giving
SELECT * from Recipes where TITLE IN ('+@search+')
SELECT * from Recipes where TITLE =@search
SELECT * from Recipes where TITLE =$[@search]
But none seem to work.
Thanks in advance
Try this