How to get stored procedure out put to xml in sql server 2005

  • Hi All,

    I have written a stored procedure with two parameters in which I have declared some temporary tables and in the main select statement I am doing some calculations and giving user friendly column name.

    Now I have to export the output of stored procedure to XML

    so for this I am using 'FOR XML RAW' or 'FOR XML AUTO'

    Now when I am executing the stored procedure it is giving wrong and incomplete XML output

    So please tell me where I am wrong and what is the right way to get out put in XML

  • Hi

    Could you please paste the code of your stored procedure and how are you calling that.

  • Hi

    If the FOR XML AUTO fits your requirements you can simply add the name for the root element to be created:

    FOR XML AUTO, ROOT('root')

    Greets

    Flo

  • Hi All,

    Thanks for your kind suggestions. I was doing right but the XML output which I was copy and pasting on notepad was wrong axction because it was not copying whole XML output.

    But when I was clicking on the XML output it is opening in new query analyzer with whole XML output.

    So I got my XML out put.

    Again Thanks friends.

Viewing 4 posts - 1 through 3 (of 3 total)

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