here's my stored procedure.
ALTER PROCEDURE [dbo].[SearchIngredients]
@Term NVARCHAR(50)
AS
BEGIN
SET NOCOUNT ON;
SELECT *
FROM dbo.FoodAbbrev
WHERE Name LIKE '%@Term%'
ORDER BY Name
END
I kept getting no result back. I think its because I put the varaible in the single quote and probably DB thinks that is part of string, not a variable. tried a few other ways, still cannot fix it, please help me.
I also tried. still get nothing back.
SET @Term = '''%' + @Term + '%'''
SELECT *
FROM dbo.FoodAbbrev
WHERE Name LIKE @Term
ORDER BY Name