Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.74 KB | None | 0 0
  1. SELECT [XML_Content].query('<root>{
  2.   for $town in /root/actDate/district/town
  3.   return
  4.   <row townId = "{data($town/@townId)}" districtId="{data($town/../@districtId)}"/>
  5.   }</root>')  
  6. FROM dbo.[Files]
  7.  
  8. <root>
  9.   <row townId="0" districtId="0" />
  10.   <row townId="79228162514264337593543950335" districtId="0" />
  11.   <row townId="1" districtId="0" />
  12.   <row townId="79228162514264337593543950334" districtId="79228162514264337593543950335" />
  13.   <row townId="2" districtId="79228162514264337593543950335" />
  14.   <row townId="79228162514264337593543950333" districtId="79228162514264337593543950335" />
  15.   <row townId="3" districtId="1" />
  16.   <row townId="79228162514264337593543950332" districtId="1" />
  17.   <row townId="4" districtId="1" />
  18. </root>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement