I want to parse a xml and insert it’s data to my db. now which one is better? Sending xml as parameter to 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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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!