Skip to content
Advertisement

create a query that fetch data as XML more faster with filters

i’m using SQL server 2014, trying to get xml from SQL server in an hierarchical structure, `

`

and i got outPut as

this query too 2s, but there is a lot of nodes without attributes

so i tried set @data.modify('delete //model[empty(@ModelId)]') to remove these nodes this takes nearly 30s. can anyone suggest a faster and better way to fetch xmal faster

Advertisement

Answer

Use xml linq :

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement