By jacobsebastian
via beyondrelational.com
Published: May 10 2010 / 03:47
In the last two posts we examined FOR XML AUTO and FOR XML RAW. It is time for us to examine the most hated FOR XML directive: EXPLICIT.
EXPLICIT is the most powerful directive that you can use with FOR XML, which gives you total control over the shape of XML being generated. Using EXPLICIT mode, you can generate XML documents with almost any structure and shape. However, the syntax of FOR XML EXPLICIT is quite complex and that makes many people hate this handsome young guy!
FOR XML AUTO, RAW and PATH can be used along with a SELECT query to transform the result of the query into an XML document. You can add FOR XML AUTO, RAW or PATH to 'almost' any SELECT query and generate XML documents. However, FOR XML EXPLICIT expects the output of the relational query to be in a certain format. It expects a few mandatory elements in the query output and expects certain relationships established among the rows tha represents an XML hierarchy.
Add your comment
Voters For This Link (12)
-
jacobsebastian -
mswatcher -
pinaldave -
patelkhyati82 -
jason143 -
ddramireddy -
mikedavem -
agilhotra -
dpalkar -
mitchp -
davneter -
peter.d.rush


