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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:46:21+00:00 2026-05-15T09:46:21+00:00

I have a table that contains some meta data in an XML field. For

  • 0

I have a table that contains some meta data in an XML field.

For example

<Meta>
    <From>tst@test.com</From>
    <To>
        <Address>testing@123.com</Address>
        <Address>2@2.com</Address>
    </To>
    <Subject>ESubject Goes Here</Subject>
</Meta>

I want to then be able to query this field to return the following results

From                 To                 Subject
tst@test.com         testing@123.com    Subject Goes Here
tst@test.com         2@2.com            Subject Goes Here

I’ve written the following query

SELECT
    MetaData.query('data(/Meta/From)') AS [From],
    MetaData.query('data(/Meta/To/Address)') AS [To],
    MetaData.query('data(/Meta/Subject)') AS [Subject]
FROM 
    Documents 

However this only returns one record for that XML field. It combines both the 2 addresses into one result. Is it possible for split these on to separate records?

The result I’m getting is

From                 To                         Subject
tst@test.com         testing@123.com 2@2.com    Subject Goes Here

Thanks

Gav

  • 1 1 Answer
  • 1 View
  • 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-15T09:46:21+00:00Added an answer on May 15, 2026 at 9:46 am

    You need to return the XML and then parse it using something like the following code:

    StringReader stream = new StringReader(stringFromSQL);
    XmlReader reader = XmlReader.Create(stream);
    
    while (reader.Read())
    {
        // Do stuff
    }
    

    Where stringFromSQL is the whole string as read from your table.

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

Sidebar

Related Questions

I have a jsp that contains a table with some information from db. I
I have a table that contains some data given below. It uses a tree
I have a table that contains some user data: user_id | guest_id | time_seen
I have a fact table that contains some finance data. There is a column
I have a table that contains some statistic data which is collected per hour.
I have a table that contains some sensitive data that I would like to
I have a SQL Server table that contains some datetime data. I'm using a
I have an HTML table that contains some 500 rows. I have an input
I have a table that contains all the data about users . Users can
I have a table that contains common entries in two columns. For Example: Column1

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.