Continued from FOR XML EXPLICIT Tutorial - Part 2 Having fixed the problem with the sort order, let us go ahead with the rest of the code. Let us add Addresses under the AddressCollection node and come up with the final version of the code. We need to add a new level, Tag 4 . Note that I used AgentID...
Continued from FOR XML EXPLICIT Tutorial- Part 1 Let us move ahead. Under each agent, we need a node named AddressCollection . Let us add the code for that. SELECT 1 AS Tag, NULL AS Parent, NULL AS 'Agents!1!' , NULL AS 'Agent!2!AgentID' , NULL AS 'Agent!2!Fname!Element' , NULL...
The primary purpose of namespaces is to resolve ambiguity. An XML document can contain more than one element with the same name, but each of them may have different meaning. For example, an XHTML document may have a <table> element which refers to an HTML table. But it can also have a <table>...
SQL Server 2005 came up with a suite of exciting XML features. I am pretty sure that most developers working with SQL Server 2005 must be using the XML support. In the past few years, I had seen a lot of discussion (or would you call it a debate?) about XML support at the database level. Some people...
With SQL Server 2005 we can generate XML output using different methods. Using TSQL keyword FOR XML along with AUTO, RAW, PATH and EXPLICIT we could generate almost any XML structure that we might need. PATH is a very powerful keyword which allows a great deal of customization on the structure of the...