How can i read 117(LockboxID) value from below XML in sql server. Please help me
'
An exception was generated for LockBoxID=117.
Amount = 575.3600
Total = 276.2500
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 3, 2013, 4:25 AM EDT
Please provide more details. Are you trying to read the XML value in ASP.NET or SQL?
Regards,
Iftikar
Ajitender VijayRank #6,843 · 255 reputationPosted Jul 3, 2013, 4:30 AM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 3, 2013, 4:46 AM EDT
select xml_data.value('(/commdef/LockboxID/.)[1]', 'varchar(10)') as [LockboxID] from tabelname
or for any help check this link
http://stackoverflow.com/questions/15846990/extracting-attributes-from-xml-fields-in-sql-server-2008-table
Ajitender VijayRank #6,843 · 255 reputationPosted Jul 3, 2013, 4:51 AM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 3, 2013, 5:04 AM EDT
create table #temp (xml_data xml)
insert into #temp values
('
select xml_data.value('(/commdef/field/.)[4]', 'varchar(10)') as [LockboxID] from #temp
any problem reply
if its help you mark it as answered