Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 76407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:40:07+00:00 2026-05-10T20:40:07+00:00

The following doesn’t work, but something like this is what I’m looking for. select

  • 0

The following doesn’t work, but something like this is what I’m looking for.

select * from Products where Description like (@SearchedDescription + %) 

SSRS uses the @ operator in-front of a parameter to simulate an ‘in’, and I’m not finding a way to match up a string to a list of strings.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:40:08+00:00Added an answer on May 10, 2026 at 8:40 pm

    There are a few options on how to use a LIKE operator with a parameter.

    OPTION 1

    If you add the % to the parameter value, then you can customize how the LIKE filter will be processed. For instance, your query could be:

     SELECT name  FROM master.dbo.sysobjects  WHERE name LIKE @ReportParameter1 

    For the data set to use the LIKE statement properly, then you could use a parameter value like sysa%. When I tested a sample report in SSRS 2008 using this code, I returned the following four tables:

     sysallocunits  sysaudacts  sysasymkeys  sysaltfiles 

    OPTION 2

    Another way to do this that doesn’t require the user to add any ‘%’ symbol is to generate a variable that has the code and exceute the variable.

     DECLARE @DynamicSQL NVARCHAR(MAX)    SET @DynamicSQL =   'SELECT  name, id, xtype  FROM dbo.sysobjects  WHERE name LIKE ''' + @ReportParameter1 + '%''  '   EXEC (@DynamicSQL) 

    This will give you finer controller over how the LIKE statement will be used. If you don’t want users to inject any additional operators, then you can always add code to strip out non alpha-numeric characters before merging it into the final query.

    OPTION 3

    You can create a stored procedure that controls this functionality. I generally prefer to use stored procedures as data sources for SSRS and never allow dynamically generated SQL, but that’s just a preference of mine. This helps with discoverability when performing dependency analysis checks and also allows you to ensure optimal query performance.

    OPTION 4

    Create a .NET code assembly that helps dynamically generate the SQL code. I think this is overkill and a poor choice at best, but it could work conceivably.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to know why the following doesn't work. from twisted internet import defer,
I'd like to extract arguments from instances of Inequality. Following doesn't work, any idea
So, I understand that the following doesn't work, but why doesn't it work? interface
Let's say we have the EntityCollection products. Then the following doesn't work: foreach (var
The following doesn't come across as a cross-domain issue, but it smells like one.
So, the following doesn't seem to work. What am I missing? $sql = SELECT
I would like to do the following (which doesn't work, it is just to
The following doesn't work, because it doesn't wait until the process is finished: import
How come the following doesn't work? CREATE FUNCTION Test (@top integer) RETURNS TABLE AS
I'm trying to get my head around why the following doesn't work. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.