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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:16:26+00:00 2026-06-18T09:16:26+00:00

This is another ‘for xml’ question, but I’m unsure whether this can be done

  • 0

This is another ‘for xml’ question, but I’m unsure whether this can be done without explicit mode. If it can’t, then I’ll just have to live with it.

The following is my select statement currently:

    SELECT
        [stream_id] as '@stream_id',
        [path_locator] as '@path_locator',
        [parent_path_locator] as '@parent_path_locatr',
        [file_type] as '@file_type',
        [cached_file_size] as '@cached_file_size',
        [creation_time] as '@creation_time',
        [last_write_time] as '@last_write_time',
        [last_access_time] as '@last_access_time',
        [is_directory] as '@is_directory',
        [is_offline] as '@is_offline',
        [is_hidden] as '@is_hidden',
        [is_readonly] as '@is_readonly',
        [is_archive] as '@is_archive',
        [is_system] as '@is_system',
        [is_temporary] as '@is_temporary',
        [name] as '/name',
        dbo.udf_GetChildren(path_locator)
    FROM @Merged
    WHERE path_locator.GetLevel() = 1
    FOR XML PATH'file'), ROOT('files'), TYPE

This outputs the following xml:

 <files>
   <file stream_id="" etc...>
      <name>NAME</name>
   </file>
 </files>

This isn’t bad, but what I’d really like is to get the name element’s value as the value of the file element. This is such a simple task I assume it can be done without explicit mode, but I’ve been wrong pretty often about such things.

I’ve tried using the ‘/’ marker, but this doesn’t seem to have the effect I want (for example Update XML node (in an XML column) in SQL Server 2005 with another column value in the same row).

edit:
The desired xml would be simply this:

 <files>
   <file stream_id="" etc...>NAME</file>
 </files>

Many thanks for the help.

  • 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-18T09:16:26+00:00Added an answer on June 18, 2026 at 9:16 am

    Use name as '*'

    Columns with a Name Specified as a Wildcard Character

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

Sidebar

Related Questions

This is another probably very simple question, but I haven't been able to find
this is another question that I want to know that how to apply any
This seems like another fairly simple thing to do, but I'm again struggling on
I asked this question in another post - How do I put a <div>
I'm going to give this another try because my last question might have been
I thought I had this answered from a previous post, but I still can't
I'm not sure if I'm overthinking this but in the past, I've done something
I I have read this url first official and this another blog But they
Is this another MS Access 2000(2007)-ism? If I type the following: foo = blah
i need to show a menu that derive another menu and this derive another

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.