|
Posted by CK on 11/20/06 17:46
USE AdventureWorks
GO
SELECT SalesOrder.SalesOrderID,
SalesOrder.OrderDate, SalesOrder.AccountNumber, SalesOrder.Comment,
Item.ProductID, Item.OrderQty FROM Sales.SalesOrderHeader SalesOrder
JOIN Sales.SalesOrderDetail Item
ON SalesOrder.SalesOrderID = Item.SalesOrderID WHERE
SalesOrder.SalesOrderID = 43659
1. Examine the query in the file, noting that it retrieves data from
the
Sales.SalesOrderHeader and Sales.SalesOrderDetail tables in the
AdventureWorks database.
2. ON the toolbar, click Execute.
3. Review the query results.
?Modify the query to retrieve <row> elements
1. Make the necessary changes to the query to return the data in the
following XML format (hint: use FOR XML).
<row>
<SalesOrderID>43659</SalesOrderID>
<OrderDate>2001-07-01T00:00:00</OrderDate>
<AccountNumber>10-4020-000676</AccountNumber>
<ProductID>776</ProductID>
<OrderQty>1</OrderQty>
</row>
<row>
<! - remaining rows go here. -->
</row>
Thanks In Advance,
~CK
[Back to original message]
|