parse xml data
I have a xml data passed to the stored procedure like below
<root>
<id>1</id><firstname>john</firstname><lastname>doe</lastname>
</root>. I tried parsing it using node() method but it only works for
one node. I used the following code
select
person.id.value('.', 'int') as personID
from
@xml.nodes('/root/id') as person(id)
my question is what do i need to do to return all the three node values at once.
thanks for sugguestions.
|