formatted xml with 'for xml'

  • Dear All,

    my query is below which is working fine

    WITH tempPagedag AS

    (

    SELECT *, ROW_NUMBER() OVER

    (order by agency_ID) as RowNumber FROM Agency

    )

    SELECT * FROM tempPagedag WHERE RowNumber > 0 AND RowNumber <= 50 for xml auto

    but 'for xml' clause generates attribute based xml and i want element based xml.

  • Use FOR XML PATH instead of FOR XML AUTO.

    Another options is to use the ELEMENTS directive.

    FOR XML AUTO, ELEMENTS

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply