Created
September 2, 2016 00:42
-
-
Save anonymous/f17e882b788e0fcf610d662c5398de1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Let's get all Persons | |
SELECT t.Person.value('*:ID[1]', 'INT') AS [ID], | |
t.Person.value('*:Name[1]', 'VARCHAR(50)') AS [NAME], | |
t.Person.value('*:DOB[1]', 'DATE') AS [DOB], | |
t.Person.value('*:Address[1]', 'VARCHAR(50)') AS [ADDRESS], | |
t.Person.value('*:Vehicles[1]/*:Vehicle[1]', 'VARCHAR(50)') AS [VEHICLE1], | |
t.Person.value('*:Vehicles[1]/*:Vehicle[2]', 'VARCHAR(50)') AS [VEHICLE2] | |
FROM @XML.nodes('*:People/*:Person') AS t(Person) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment