Database Reference
In-Depth Information
Figure 11-57(a) shows the query in the Microsoft SQL Server Management Studio, and
Figure 11-57(b) shows the full results in a tabbed window. Figure 11-57(c) shows results in an
XML document.
SQL Server uses the order of the tables in the FROM clause to determine the hierarchi-
cal placement of the elements in the generated XML document. Here the top-level element is
CUSTOMER, and the next element is ARTIST. The CUSTOMER_ARTIST_INT table does not
appear in the generated document because no column from that table appeared in the SQL
SELECT statement.
Figure 11-57
FOr XML aUtO, ELEMENtS
Example Displaying
Customer and artist
Interests
The SQL FOR XML
AUTO, ELEMENTS
query
The SQL FOR XML
AUTO, ELEMENTS
query results—click
this cell to display the
results in a separate
window
(a) FOr XML aUtO, ELEMENtS Query
The SQL FOR XML
AUTO, ELEMENTS
query results
(b) FOr XML aUtO, ELEMENtS results in the Microsoft SQL Server
Management Studio
Search WWH ::




Custom Search