Tuesday, March 27, 2012

Cant get LIKE to work

I have the below procedure that will not work- I must be losing my mind, this is not that difficult - mental roadblock for me.

Using SQL Server 2000 to create SP being called by ASP.Net with C# code behind

stored procedure only returns if input exactly matches L_Name

PROCEDURE newdawn.LinkNameLIKESearch
@.L_Name nvarchar(100)
AS
SELECT [L_Name], [L_ID], [C_ID], [L_Enabled], [L_Rank], [L_URL]
FROM tblContractorLinkInfo
WHERE L_Name LIKE @.L_Name
RETURN

I tried: WHERE L_Name LIKE ' % L_Name % ' no luck. What am I missing?

Thank you

try it like this:

LIKE '%' + @.L_Name + '%'

|||

Ever have a day when you really fell dumb - I am having way too many of them.

Thank you.

No comments:

Post a Comment