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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:13:17+00:00 2026-06-01T04:13:17+00:00

MY Table like this: id Tag platform 1 #class1,#class2 CS 2 #class1 PS 3

  • 0

MY Table like this:

id  Tag                platform
1  #class1,#class2      CS
2  #class1              PS
3  #class2              CS

if i pass “‘#class1′” as parameter to SP getting only one record that is 2nd record.But need to 1st and 2nd records because #class1 contains in both 1,2 rows.Please tell me how to write this.I am using IN statement as of now.By using getting only record.

MY SP:

ALTER PROCEDURE [dbo].[usp_Get]-- 1,"'#class1,#class2'"
@Appid INT,
@TagList NVARCHAR (MAX)
AS

BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
 SET NOCOUNT ON;
 SELECT @TagList = '%' + RTRIM(LTRIM(@TagList)) + '%';
  declare @tags varchar(MAX)
    set @tags = @TagList
    create table #t (tag varchar(MAX))
    set @tags = 'insert #t select ' + replace(@tags, ',', ' union select ')
    exec(@tags)
Select 
    id FROM dbo.List WHERE ((appid=@Appid)) AND ((Tags LIKE(select tag from #t)
END

How to modify please tell me…

Thanks in advance..

  • 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-01T04:13:20+00:00Added an answer on June 1, 2026 at 4:13 am

    One solution would be to use LIKE operator in your stored procedure:

    CREATE PROCEDURE FindTag @TagName char(50)
    AS
        SELECT @TagName = '%' + TRIM(@TagName) + '%';
    
        SELECT Tag 
        FROM MyTable 
        WHERE Tag LIKE @TagName;
    
    GO
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 tables: posts tags Tags table is structured like this: post_id tag
I have a Table like this one: |UserId | ContactID | ContactName --------------------------------------- |
the table looks like this: tag | entryID ----+--------- foo | 1 foo |
I have display tag like this. <display:table class=displayTable id=orgList name=${sessionScope.organisationArray} requestURI= pagesize=13 defaultsort=1 sort=list>
Imagine I have table like this: id:Product:shop_id 1:Basketball:41 2:Football:41 3:Rocket:45 4:Car:86 5:Plane:86 Now, this
If I have a table like this: CREATE TABLE sizes ( name ENUM('small', 'medium',
I have a table like this: <table> <tfoot> <tr><td>footer</td></tr> </tfoot> <tbody> <tr><td>Body 1</td></tr> <tr><td>Body
I have a table like this (Oracle, 10) Account Bookdate Amount 1 20080101 100
I have a database table like this: id version_id field1 field2 1 1 texta
I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ

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.