我想知道如何从sql server 2008上使用xml的查询中获得以下内容。
我需要:
1. The XML Version
2. The xmlns
3. And one parent node called "Brand" containing many child nodes called "Name"我也尝试过...For XML Auto,但这给了我一个节点
<Brands Name="nameofBrand">相反,我需要
<Brand><Name>nameofbrand</Name></Brand>编辑:
现在这个查询非常简单……
Select Distinct
Name
From
Brands
For XML AUTO发布于 2011-03-24 23:17:28
下面是一个查询,它获得了品牌节点中的姓名列表。我不明白您想要对版本或xmlns做什么。
select (
select distinct Name
from YourTable for xml path(''), type)
for xml path('Brands')https://stackoverflow.com/questions/5420855
复制相似问题