Reply to Re: Help with FOR XML - How do I return the results like this?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация