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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:36:09+00:00 2026-06-11T15:36:09+00:00

in a previous SO post: The argument 1 of the XML data type method

  • 0

in a previous SO post: The argument 1 of the XML data type method "value" must be a string literal I failed to figure out a solution but if anyone can answer this question, I can solve that previous problem.

Question: how do I retrieve the full path of a given node, in the way that I can retrieve the name of a given node?

declare @x xml; set @x='<ROOT><a>111</a></ROOT>'
SELECT @x.value('local-name((/ROOT/a)[1])', 'varchar(256)')

the above will return ‘a’. how do I return ‘/ROOT/a’?

  • 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-11T15:36:10+00:00Added an answer on June 11, 2026 at 3:36 pm

    there is no solution to this problem at present (as of SQL Server 2008) simply because the SQL engine does not support the entire XQuery language. there are functions, as per the spec, that could be used to get ancestors and using FLWOR the path could be constructed, but the ancestry functions have not been implemented. sadly.

    however, as for the issue that got me here to begin with (see my original SO post) – that found an acceptable solution

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

Sidebar

Related Questions

This relates to my previous post: jQuery .load Method causing page refresh AJAX I
In a previous post it was mentioned that an overload of the Select method
Further to my previous post about obtaining data from objects on the server using
I'm trying to figure out when my type parameters will be in scope. I
on my previous post I needed to distribute data of pgm files among 10
From previous post, I learnt that for there are two ways, at least, to
in my previous post I was asking how to generate numbers following a normal
Please refer my previous post here . I did changes accordingly but getting error.
This is a previous post detailing a CI setup for Python. The asker and
I accidentally deleted my previous post. Could I know exactly why I should compile

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.