March 3, 2010 at 3:01 am
Hi,
I heard using XML data as parameter will hurt the performance of T-SQL? Is that true?
For me, using XML data as parameter, will get rid of looping at business-tier.
Need explanation
March 3, 2010 at 3:25 am
I wouldn’t say that using XML parameter should hurt performance. As in many other things, I would say that it depends. If XML parameter would be something that only hurts performance, then most chances are that it wouldn’t be supported. Now if you are talking about the possibility that sometimes it is better to use a different data type, then I would agree to that. Each datatype and technique has a place that it helps and a place that it doesn’t.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
March 3, 2010 at 4:10 am
To give an example of Adi's great explanation regarding the right place for the right tool:
If you'd need to send 3 or 4 parameter to a procedure, then a comma separated list would perform better than the XML solution.
But if you'd need to send a larger array to a proc and don't us SS2K8, the in most cases XML is the way to go.
So, to second Adi: It depends. 🙂
March 3, 2010 at 5:08 am
Ok guys. Felt better now.
For me, XML parameter will hurt performance it's a myth
March 3, 2010 at 5:38 am
miss.delinda (3/3/2010)
Ok guys. Felt better now.For me, XML parameter will hurt performance it's a myth
No it's not. And yes, it is.
Like with any other tool/command/feature: if used wrong, it will hurt performance. If used correctly, the overhead caused by the xml structure will be minor.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply