Hi there... having real brain hurt with a stored procedure:
Code:ALTER PROCEDURE [dbo].[SearchClaimants] -- Add the parameters for the stored procedure here @criteria char(20), @col char(20) AS SELECT forename_str + ' ' + surname_str AS Name, nino_str as NINO, address1_str AS Address FROM claimant WHERE surname_str LIKE 'm' + '%' --WHERE surname_str LIKE '%ste%' ORDER BY Name exec searchclaimants @criteria = 'm', @col = 'str_surname'
Now... this works and returns the expected results, but when I actually try to substitute the 'm' for the @criteria variable it doesn't work.
Can anyone tell me if there is a problem with using LIKE in a sp?
THanks.
DS




Bookmarks