开发者

Which one have better performance for parsing xml ? XQuery or parse xml programmatically?

I want to parse a xml and insert it's data to my db. now which one is better? Sending xml as parameter t开发者_JAVA技巧o sql server and parse it with XQuery or parse it in my c# code?

I want to use recursive cte combine with xquery. is it best solution?


Such a thing always depends on your specific case. For example: if you have a very big XML file and you can reduce the amount of data on the client significantly before sending it over the network, the C# solution may be faster. On the other hand, if your C# solution generates 100 Update-SQL statements from a single XML record, making at least 100 round trips where you otherwise would need just one round trip, the server solution may be faster.

And, also your available hardware (client/server/network speed) makes a reasonable difference between those two solutions.

Best thing when dealing with performance issues is always: measure it!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜