Please help me regarding xml output

  • Can you help me with this please...

    I wrote a query in ms sql n when i execute this it gives xml output.

    When i copy tht information and paste in xml note pad every it works fine. Here is the problem according the client requirement i also need the above 2 lines should be represented in my output...

    <?xml version="1.0" ?>

    <?DOCTYPE Cxxxxxxxxxxxx "Cxxxxxxxxxxxx.dtd"?>

    <Root>......</Root>

    When iam executing my query i am getting the result from root. but i need along with those 2 lines.

    I am not getting any ideas how to add those 2 lines to my query in sql to get xml output... Could you please suggest me anything please.

    Thanks a lot...

    Sam .

  • UNION ALL

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Sorry... perhaps that was too short of a hint.

    Perhaps something like this would do?

    SELECT '<?xml version="1.0" ?>'

    UNION ALL

    SELECT '<?DOCTYPE Cxxxxxxxxxxxx "Cxxxxxxxxxxxx.dtd"?>'

    UNION ALL

    ... your XML query here...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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