XML query() works, value() requires singleton found xdt:untypedAtomic

前端 未结 3 1649
轻奢々
轻奢々 2020-12-16 09:40

I have a typed xml document stored as text. So I use CONVERT the data type to xml by using a Common Table Expression in order to be able to use XML methods:

         


        
3条回答
  •  情书的邮戳
    2020-12-16 10:18

    For those interested in performance I ran a query to compare these approaches and the first option with "() and add a [1]" was MUCH faster than ".query('strFranchise').value('.',...)".

    Difference in Execution plan was 15% to 85% when running one after the other on same data. So ()[1] is over 5 times faster! Execution plan is much different.

提交回复
热议问题