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 9131259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:06:51+00:00 2026-06-17T08:06:51+00:00

OK I have a question to which an answer might be simple but im

  • 0

OK I have a question to which an answer might be simple but im not sure how to do it:

Question:
How do i use IN with LIKE?

Why Not Duplicate:
Well I know if i have multiple strings i can use OR to check. But this is not the case with what i am trying to do.

Question Explaination:
I have an SP with a parameter @path, now i would like to send multiple paths, separated by delimiter, (to avoid calling sp multiple times). I split the string using a custom function which returns a table with splited values.
Now how would i go about using the values from that splited values table to be used with LIKE operator.

What I have done so far:

declare
    @path varchar(max) = 'CompanyRules/Billing/IntegrationServices|CompanyRules/Reports/IntegrationServices',
    @default_code varchar(max) = '1'

    declare @tempTable TABLE(path varchar(max))

    INSERT INTO @tempTable (path)
    SELECT split from fn_splitby(@path, '|')

    select prg.path, prg.default_code, prmd.optional_property_1, prmd.optional_property_2, prmd.optional_property_3, prmd.optional_property_4, prmd.optional_property_5, prmd.optional_property_6
    from pdm_rule_group prg, pdi_rule_master prmd
    where prg.path = prmd.path
    AND prg.path in (select path from @tempTable)
    AND prg.default_code != @default_code

The this will not yield any result.

Possible Solution:
What i though was that i have to loop through the @tempTable and then create separate strings to be used with LIKE. Which im sure is a bad solution, and may have some other solution to it.

  • 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. Editorial Team
    Editorial Team
    2026-06-17T08:06:52+00:00Added an answer on June 17, 2026 at 8:06 am

    Replace this statement

    AND prg.path in (select path from @tempTable)
    

    with

    AND EXISTS (select 1 from @tempTable where   prg.path  like "%"+path+"%" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question which I am sure is simple but I have slight
I have a question to which I have not found an answer. Let's say
Simple question which I can't seem to find an answer of: I have two
I feel like the answer to this question is really simple, but I really
This question might appear very simple, but i haven't found an answer yet, so
I have a simple security question which I just can't find the answer to.
I have my own answer to this question, which I'll post, but I wanted
This might be simple to answer ..I have a div inside which I have
This question might sound simple but I can't find the answer i'm looking for.
I have a question that might seem simple, but yet I was unable to

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.