SSRS -Using 'like' statement slows down Report

  • Hi All

    I am using 2008 BIDS to create a report and I have a parameter where users can enter the first few characters of a field and the report will pick

    up all Numbers that start with what ever they enter.

    I have used a 'like' statement for this:

    (dbo.MBB370.TRREF_TRV LIKE @Lotno + '%')

    Which works fine, but the report takes about 4 minutes to run, where as if I just left it as

    (dbo.MBB370.TRREF_TRV = @Lotno) and the users enter the full lot number the report takes seconds to run.

    It runs slow within BIDS and on the Reporting Site.

    Can anybody advise how to make the report run quicker please? Is there another function/statement I can use??

    Thanks

    R

  • For some reason, I found it was the second parameter that was slowing it down,

    I deleted it and recreated it and now is working a treat!

  • When using the LIKE comparison, SQL will not use any index on the column being queried, causing performance to suffer.

    Where possible, use a more specific operator, or try using BETWEEN for your specific case.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply