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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:27:44+00:00 2026-05-15T11:27:44+00:00

Following is the data and Select statement to work with : declare @XMLdata xml

  • 0

Following is the data and Select statement to work with :

declare @XMLdata xml
set @XMLdata = '
    <taggroup key="pros" name="Le pour">
      <tag isuseradded="false" count="1">Bonne qualité</tag>
      <tag isuseradded="false" count="1">Correspond à mes attentes</tag>
      <tag isuseradded="true" count="1">Impeccable</tag>
      <tag isuseradded="false" count="1">Prix abordable</tag>
    </taggroup>
    '
select      
    ParamValues.ID.value('(./@key)','nvarchar(max)') as TagGroupKey,
    ParamValues.ID.value('(./@name)','nvarchar(max)') as TagGroupName,
    ParamValues.ID.value('(./tag)[1]','nvarchar(max)') as TagValue,
from @XMLData.nodes('taggroup') as ParamValues(ID)

I need to extract the 4 tag values
(Bonne qualité,Correspond à mes attentes,Impeccable,Prix abordable)
without actually going to the tag level since that is impacting the performance.

  • 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-05-15T11:27:46+00:00Added an answer on May 15, 2026 at 11:27 am

    I am not 100% sure what you are looking for, but to get all of the data under tag without the tag element itself you would use the following xpath:

    ./tag/text()
    

    This (in XPATH, I am not sure about sql xml query) would return a nodeset of TEXT elements with all of the values under tag separately. So if you had 4 tag elements, there would be four separate TEXT elements.

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

Sidebar

Related Questions

I'm trying to select data from a table defined similar to the following :
I'm trying to call the SQL statement below but get the following error: System.Data.SqlClient.SqlException:
The following code executes properly when the data key has no data to send,
Suppose the following data schema: Usage ====== client_id resource type amount Billing ====== client_id
I have the following data structure (a list of lists) [ ['4', '21', '1',
Hi I have following data in the table: ID-----startDate----endDate 5549 2008-05-01 4712-12-31 5567 2008-04-17
I have a sql table which have the following data, Id City Country ---
I have a file in the following format: Data Data Data [Start] Data I
I have the following table and data in SQL Server 2005: create table LogEntries
I'm considering the following: I have some data stream which I'd like to protect

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.