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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:46:13+00:00 2026-05-26T02:46:13+00:00

I got this XML. <ArrayOfGuid xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema> <guid>475B07C8-CDEA-4000-BAAE-485336190E10</guid> <guid>6E5B87BC-CF80-4AB2-939E-ED951FA604AB</guid> <guid>31BFDA60-3BB2-49DC-8C69-10F6E1B540CA</guid> </ArrayOfGuid> Need to get

  • 0

I got this XML.

<ArrayOfGuid xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <guid>475B07C8-CDEA-4000-BAAE-485336190E10</guid>
     <guid>6E5B87BC-CF80-4AB2-939E-ED951FA604AB</guid>
     <guid>31BFDA60-3BB2-49DC-8C69-10F6E1B540CA</guid>
</ArrayOfGuid>

Need to get the results like

BatchGUID
475B07C8-CDEA-4000-BAAE-485336190E10
6E5B87BC-CF80-4AB2-939E-ED951FA604AB
31BFDA60-3BB2-49DC-8C69-10F6E1B540CA

Somehow I am stuck with

DECLARE @BatchGUID XML

SET @BatchGUID = '<ArrayOfGuid xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                      <guid>475B07C8-CDEA-4000-BAAE-485336190E10</guid>
                      <guid>6E5B87BC-CF80-4AB2-939E-ED951FA604AB</guid>
                      <guid>31BFDA60-3BB2-49DC-8C69-10F6E1B540CA</guid>
                    </ArrayOfGuid>'

DECLARE @t_xml TABLE
(
    BatchGUID XML
)

INSERT INTO @t_xml
SELECT @BatchGUID

SELECT C.* FROM @t_xml
cross apply (select name.value('guid[1]', 'uniqueidentifier') as [BatchGUID] 
from BatchGUID.nodes('//ArrayOfGuid/guid') as c(name)) as C

This is returning me

BatchGUID
NULL
NULL
NULL

Need to know what I’m doing wrong here.

Thanks,

  • 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-26T02:46:14+00:00Added an answer on May 26, 2026 at 2:46 am

    You are so very close!

    Your problem is that you’re selecting the value of the guid[1] node from within the guid node. Of course, the guid node doesn’t contain any children – you want to select the value from that node itself (which is expressed as .)

    SELECT C.* FROM @t_xml
    cross apply (select name.value('.', 'uniqueidentifier') as [BatchGUID]
    from @BatchGUID.nodes('//ArrayOfGuid/guid') as c(name)) as C
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I got this XML schema: <?xml version=1.0?> <xs:schema version=1.0 xmlns:xs=http://www.w3.org/2001/XMLSchema elementFormDefault=qualified> <xs:element name=request>
I've got this code that i'm working on : <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
I got this far: :~ curl -u username:password -d status=new_status http://twitter.com/statuses/update.xml Now, how can
I got this in a XML field in sql server 2005 <Details> <Attribute Type=org>6800</Attribute>
I got this code for a parser from this link. http://www.warriorpoint.com/blog/2009/07/19/android-simplified-source-code-for-parsing-and-working-with-xml-data-and-web-services-in-android/ I am getting
I got this XML file: <Msg UserText=start 0> </Msg> <Msg UserText=A> </Msg> <Msg UserText=A>
If I got this XML(first tag is empty) <messages> <message> <name>Kiro</name> <acc></acc> <date>20120506</date> <template>TMPL_ACC_UP</template>
Let's say that I've got this xml: <items> <item name=thumb> <downloadStream>test1</downloadStream> <downloadStream>test2</downloadStream> <downloadStream>test3</downloadStream> </item>
I got this weird error when I wanted to validate my in-memory xml Schema,
I have got this code for detection of mobile device. <?xml version=1.0 encoding=UTF-8?> <configuration>

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.