August 22, 2003 at 3:13 am
Hi there,
Writing a stored procedure that takes a text string and performs a search using the LIKE keyword. It then returns the row count using an output parameter. A seperate output parameter returns the row count of a seperate select query.
My problem is that I cannot seem to find the syntax for using wildcards within the LIKE clause. I would like to achieve the equivalent of
Select....Where....LIKE '%text%'
but using the declared input parameter instead of the text bit. Have tried;
LIKE @input_parameter
LIKE @input_parameter + '%'
LIKE '%input_parameter%'
Cant seem to get the required result.
Any help greatly apprecaited.
Rolf
August 22, 2003 at 3:28 am
Its ok sorted it out now...just a typo!
DOH.
where ..LIKE '%' + @input_parameter + '%'
August 25, 2003 at 10:48 pm
where ..LIKE '%' + rtrim(@input_parameter) + '%'
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply