Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
Venkatesh Pettem
1.6k
340
2.4k
How to read xml nodes data
Jul 2 2019 3:18 AM
I'm trying to read xml node in sql server, i couldn't able to read the node data, can any one help me,
Below is xml Content:
<entry>
<entryRelationship typeCode="SUBJ">
<encounter classCode="ENC" moodCode="EVN">
<code code="32485007" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
<sdtc:dischargeDispositionCode code="428371000124100" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
</encounter>
</entryRelationship>
</act>
</entry>
The bold node im not able to read. Below im trying in sql server
select
Code = x.v.value('(code/@code)[1]', 'VARCHAR(100)') ,
DispositionCode= x.v.value('(------?-------)[1]', 'VARCHAR(100)')
FROM @XMLValue.nodes('entry/entryRelationship/encounter') x(v)
Reply
Answers (
1
)
Blue icon with question mark on SSMS 18.0?
Problem when i Import data from Access