- SQL Server XML in ADO.NET
- XML Support in SQL Server 2000
- Well-Formed XML
- SQL Query
- C# Class
XML Support in SQL Server 2000
SQL Server 2000 is one of the cornerstones of the .NET solutions architecture. Although not yet ubiquitous, XML support in SQL Server 2000 is, nonetheless, both deep and wide. The solution demonstrated in this article leverages SQL Server 2000's new ability to return the results of a query directly as an XML document.
SQL Server 2000 introduces the new keywords FOR XML, along with modifiers such as AUTO and EXPLICIT. Using a special SQL query syntax with FOR XML EXPLICIT, you can shape the resulting XML document as desired. This includes the capability to choose which data values are represented as elements and which are represented as attributes, as well as to ensure that the resulting XML document is well-formed.