• It took me a while before I could read the article past where we generate XML with attributes and then transform it using a style sheet.

    Maybe I'm missing something, but wouldn't it have been easier to use

    SELECT DISTINCT * FROM [dbo].[sp500hst] AS StockData WHERE [Date] = '20090821' ORDER BY [Ticker]

    FOR XML PATH('StockData'),ROOT('StockMarketData')

    instead of

    SELECT DISTINCT * FROM [dbo].[sp500hst] AS StockData WHERE [Date] = '20090821' ORDER BY [Ticker]

    FOR XML AUTO,ROOT('StockMarketData')

    followed by a transform using external processes, which, while interesting, doesn't really add much to the discussion about XML in SQL?

    All my XML work uses elements not attributes (not my choice, if that matters to anyone), which may explain why this jumped out at me.