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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:26:19+00:00 2026-05-20T20:26:19+00:00

I am wondering how to obtain the following from a query using xml on

  • 0

I am wondering how to obtain the following from a query using xml on sql server 2008.

I need:

1. The XML Version
2. The xmlns
3. And one parent node called "Brand" containing many child nodes called "Name"

Also I tried …For XML Auto but that give me the node

<Brands Name="nameofBrand">

Instead I need

<Brand><Name>nameofbrand</Name></Brand>

EDIT:

The query is quite simple for now….

Select Distinct
    Name
From
    Brands
For XML AUTO
  • 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-20T20:26:20+00:00Added an answer on May 20, 2026 at 8:26 pm

    Here is a query that gets a name list in brands node. I do not understand what you want to do with version or xmlns.

    select (
      select distinct Name
      from YourTable for xml path(''), type)
    for xml path('Brands')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering what the best way is using php to obtain a list
I am using Access 2003 to access data stored in a SQL Server database
I ran a query to copy 18 million records from one table to another.
I'm wondering what is the most efficient way to obtain autocomplete results from multiple
I was wondering if it's possible to obtain the URL from Android Market applications.
i'm wondering how to exclude certain members from one dimension that have links with
When I profile my application using SQL Server Profiler, I am seeing lots of
I was wondering how to obtain this result : http://img718.imageshack.us/img718/6173/screenshot20100411at126.png This is what I
I was wondering if there was a way to obtain a hashmap of attributes
Wondering if anyone has gotten the infamous database is locked error from Trac and

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.