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


SQL Server 2005: Intro to XQuery


SQL Server 2005: Intro to XQuery

Author
Message
Mike C
Mike C
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6727 Visits: 1172
Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/mcoles/2840.asp
Cory E.
Cory E.
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1901 Visits: 10845
First and foremost, I want to say, I am a DBA. Can someone tell me why this is getting popular? I read Steve Jones' article, and this one, and I just don't get it. What value is there to get results in this format? Is this a format that is used heavily elsewhere? Please help me understand why I want to learn this...I am not opposed, just never exposed...

-- Cory
Mike C
Mike C
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6727 Visits: 1172

Hi Cory,

You're asking if XML is popular? Yes, it is very widely used.

XML is a very popular format, and it is used all over the place. A couple of examples: the newest HTML standard (XHTML) is defined as a subset of XML, Web Services use the XML-based SOAP protocol, even Microsoft Word and Excel can save your documents in XML format. A lot of websites offer XML-based Web Services as well - several of the popular Geocoding and Mapping API's for instance.

Some of the things that make XML popular are it's human-readable format, its ability to be easily created and read on just about any platform, and the capability of "transforming" an XML document into another XML document very easily. One very common example is using XSLT to convert an XML document into an XHTML document for display purposes.


DCPeterson
DCPeterson
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3587 Visits: 432

The most straightforward answer to your question is that XML is so popular because of ignorance.

At the risk of self promotion, I wrote an article on the subject several years ago. You can find it here:

http://www.sqlservercentral.com/columnists/dpeterson/isxmltheanswer.asp

Do yourself a favor, and stay away from XML.

Michael, you've done a good job of presenting the subject, but it is the subject matter itself that is fatally flawed.



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

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



*****************/
Mike C
Mike C
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6727 Visits: 1172

Hi DC -

You definitely get your point across well in your article. The only things I would add are:

1) You don't need to store native XML in the database in order to take advantage of SQL Server's XML functionality (that seems to be one of your larger concerns); you might have noticed that the XML I used in these articles was not stored in a table on the server

2) XQuery provides a simple means of querying your XML data based on just about any criteria you care to use (whether you want to retrieve albums by Artist, Genre, Producer, Label, etc.)

3) XML is not designed to be a replacement for the SQL model

SQL and XML have different goals, different priorities, and I personally believe it's a case of selecting the right tool for the job. After all is said and done, like SQL, XML is just another tool in the toolbox.

Thanks!

Michael


Michael David
Michael David
SSC Veteran
SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)SSC Veteran (272 reputation)

Group: General Forum Members
Points: 272 Visits: 112
I use XML to pass multiple records to a Stored Procedure. Since it is not possible to pass a table variable to a SP, XML is the perfect solution since you can hide the result set in XML Nodes...

Michael.
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