Thursday, March 8, 2012

Aggregate on XML Data Type

Is there a way to aggreate data on the XML data type? I have found some
examples using XQuery, but they all invlove using the Let statement in FLWOR
which is not supported in SQL Server 2005. Are there any examples out there
that shows how to aggregate data on the XML data type?
Thanks
From the BOL:
SELECT ProductModelID,
Name,
Instructions.value('declare namespace
AWMI="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions";
count(/AWMI:root/AWMI:Location)', 'int' ) as WorkCtrCount
FROM Production.ProductModel
WHERE ProductModelID=7
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
"Robert" <Robert@.discussions.microsoft.com> wrote in message
news:DA76A4FD-57CB-455B-81B9-FD9EDD0A69E7@.microsoft.com...
Is there a way to aggreate data on the XML data type? I have found some
examples using XQuery, but they all invlove using the Let statement in FLWOR
which is not supported in SQL Server 2005. Are there any examples out there
that shows how to aggregate data on the XML data type?
Thanks
|||Robert,
It is possible that let is not needed in the examples you are referring to.
Can you supply one of these examples for further examination?
Thanks,
Galex Yen
"Robert" wrote:

> Is there a way to aggreate data on the XML data type? I have found some
> examples using XQuery, but they all invlove using the Let statement in FLWOR
> which is not supported in SQL Server 2005. Are there any examples out there
> that shows how to aggregate data on the XML data type?
> Thanks

No comments:

Post a Comment