SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Some Usages for XML


Some Usages for XML

Author
Message
yousef Ekhtiari
yousef Ekhtiari
Mr or Mrs. 500
Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)Mr or Mrs. 500 (583 reputation)

Group: General Forum Members
Points: 583 Visits: 48
Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/yEkhtiari/2822.asp



Marina Odino
Marina Odino
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 61

I work since a few months with XML and I found very useful this article because I didn´t know all the advantages mencioned in the article.

Thanks and sorry for my english (I'm from Argentina).


Frank Thompson-290923
Frank Thompson-290923
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 1
This was a very useful article. What is the size limit to the VARCHAR(max) declaration?
Lisa Slater Nicholls
Lisa Slater Nicholls
SSC-Addicted
SSC-Addicted (465 reputation)SSC-Addicted (465 reputation)SSC-Addicted (465 reputation)SSC-Addicted (465 reputation)SSC-Addicted (465 reputation)SSC-Addicted (465 reputation)SSC-Addicted (465 reputation)SSC-Addicted (465 reputation)

Group: General Forum Members
Points: 465 Visits: 617

Nice. the difference in time is more pronounced at 40k rows than 20k, although if you keep going up the time to create the delimited string becomes too unbearable to test.

Question: assuming that the delimited string is coming from the outside (so you don't have to worry about the time to create it), will there be a point at which the performance of the REPLACE() function becomes unbearable also?

Small thing: You probably need to change your name for the XML proc in the code sample and also your test code, which does this:

print @CSV
exec usp_LoopVersion @CSV
exec usp_LoopVersion @CSV

Thanks,

>L<


Lee Roper
Lee Roper
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 5

XML is a good solution for some sticky problems.

For example, I'm programming an application that stores information for physical exams that a medical practice performs. The problem is that the exam is rather dynamic, in that it frequently changes (doctors are a contentious breed), and updating the database was becoming a real challenge because of the necessity of keeping old data and new data in the same tables.

The solution was to store the raw exam data in an XML field, but keep basic patient information (ExamID, DateOfService, ExamType, etc) in regular SQL Server fields. That way I could retrieve the XML field, then query and update it using XML classes directly from my windows application. The good news is that if the XML node isn't present, the XML query simply ignores that part of the query without breaking the code. In other words, the structure of the exam can change without blowing up the application or requiring major changes in my existing functions in the data layer. Really nice.

Lee...


DCPeterson
DCPeterson
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1629 Visits: 432
2,147,483,647 bytes, basically 2 Gigabytes

/*****************

If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek



*****************/
Alexander Kuznetsov
Alexander Kuznetsov
SSC-Addicted
SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)

Group: General Forum Members
Points: 421 Visits: 824

SQL Server MVP Peter DeBetta has recently wrote on the same problem:

http://sqlblog.com/blogs/peter_debetta/archive/2007/02/12/multiple-valued-parameters.aspx

I think his conclusions are different.


Mian Rehmat
Mian Rehmat
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 8

Well it was great article for the developers who want to know about the advantages of XML in SQL SERVER 2005.

Regards

Mian Rehmat

Local Govt, UK.


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search