question

mohit avatar image
mohit asked

XML using sql

declare @a varchar(max) =' 77 88 66 44 ' I have this xml and when i write below sql statement declare @Xml xml set @xml=@a SELECT bar.value('local-name(.)','VARCHAR(50)') ColumnName ,bar.value('./.','VARCHAR(Max)') as value FROM @Xml.nodes('//Table/*') AS M(bar) i get this as output ColumnName value LS 77 RS 88 LS 66 RS 44 but with this i want id and rowOrder also so output i want is ColumnName value id roworder LS 77 table1 1 RS 88 table1 1 LS 66 table2 2 RS 44 table3 3 pls provide solution So what i want is to read the information which is in bold letters So what i want to read below information also i.e.id and roworder
sqlxml
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.