How to convert XML to a datatable in sql server

  • Hi all..

    How to convert XML to a datatable in sql server?? or inside a stored procuedure (not using pgmg lang like C# etc. ).

    i couldnt get a proper answer in the net.

    Thanks

  • There are essentially two different options: XQuery and OPENXML. There are plenty of examples in BOL and online. If you need help with a specific problem, you'll need to provide more information.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • mvijaykumar.mca (2/15/2012)


    Hi all..

    How to convert XML to a datatable in sql server?? or inside a stored procuedure (not using pgmg lang like C# etc. ).

    i couldnt get a proper answer in the net.

    Thanks

    The likely reason you didn't find much on the internet about it is simply because you didn't know a key word. Instead of "convert", the word should be "shred". Search for the following in Google for some much better answers than you can get in Books Online.

    SHRED XML SQL Server

    --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