XML Xquery Issue | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

XML Xquery Issue

Hi guys ,
i’m some how a beginner to XML and i have a question suppose i have the following XML <league num="1">
<clubs>
<club num="1">Aresnal</club >
<club num="2">Chelsa</club >
<club num="3">Man utd</club >
</clubs>
</league >
<league num="2">
<clubs>
<club num="1">Real</club >
<club num="2">Barca</club >
</clubs>
</league> using Xml data type and xquery , how to get scalar value ,using xml.value , of all clubs with num="2" So , result should be result——————————————————- Chelsa barca Thanks in advance
quote:Originally posted by hello.everyone.hello Hi guys ,
i’m some how a beginner to XML and i have a question suppose i have the following XML <league num="1">
<clubs>
<club num="1">Aresnal</club >
<club num="2">Chelsa</club >
<club num="3">Man utd</club >
</clubs>
</league >
<league num="2">
<clubs>
<club num="1">Real</club >
<club num="2">Barca</club >
</clubs>
</league> using Xml data type and xquery , how to get scalar value ,using xml.value , of all clubs with num="2" So , result should be result——————————————————- Chelsa barca Thanks in advance

Check this and other sites for OpenXML:
http://www.sqlservercentral.com/columnists/rVasant/usingopenxml.asp Thanks,
DilliGrg
some other sites for samples:
http://builder.com.com/5100-6388_14-6140404.html
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql25xmlbp.asp
]]>