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

  • SEARCH
  • Home
  • 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

Ask A Question

Stats

  • Questions 61k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I would recommend using a Panel. <asp:Panel runat='server' id='pnlErrors' Visible='false'>… May 11, 2026 at 9:56 am
  • added an answer Use the HttpRuntime.Cache static property; it works fine. May 11, 2026 at 9:56 am
  • added an answer In general, I don't think this is possible. It works… May 11, 2026 at 9:56 am

Related Questions

The following doesn't work, but something like this is what I'm looking for. select
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
So, I understand that the following doesn't work, but why doesn't it work? interface
The following code doesn't compile with gcc, but does with Visual Studio: template <typename
Any idea why the following code doesn't print the amount of characters in the
Given the following code (that doesn't work): while True: # Snip: print out current
Why doesn't the following work? (apply and (list #t #t #f)) While the following
Why doesn't the following work (Python 2.5.2)? >>> import datetime >>> class D(datetime.date): def

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.