Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

'like' returns all the records

happyhappy Member Posts: 11
The following code returns ALL the rows in the table
ALTER PROCEDURE dbo.crdGLSearchTreeSP
( @SearchString as varchar)
AS
SELECT ..., ....
FROM dbo.crdFinanceGrouping
WHERE (RTRIM(FinanceGroupingName) LIKE '%' + @SearchString + '%')

If I replace the @SearchString with a quoted value, eg LIKE '%' + 'REVENUE'+ '%' it returns as expected - the three records where FinanceGroupingName includes the string REVENUE. The RTRIM() was included after reading BOL but it should not be necessary.

I really appreciate some help in limiting the records using LIKE.
Sign In or Register to comment.