You are here: Help with FOR XML - How do I return the results like this? « MsSQL Server « IT news, forums, messages
Help with FOR XML - How do I return the results like this?

Posted by CK on 11/20/06 17:43

USE AdventureWorks

GO



-- Retrieve order manifest

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).



Thanks In Advance,

~CK

 

Navigation:

[Reply to this 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

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