insert XML data in to sqlserver 2005 table in their respective columns....

  • Hi,

    I want to load xml file i to the sql server 2005 table.

    Foe e.x i have a xml file containing details firstname and lastname

    now i want to load this data into the table in sql server 2005 database.

    The table contains 2 columns: firstname and lastname

    i want to load this xml data to this table in to the corresponding column.

    so is it possible through T-sql query.ID yes,please let me know and if not please give me some alternative to load this xml data in to the table.

    regards,

    pranav

  • Hello Pranav,

    With the limited information you provided all I can get you is a limited answer:

    Please check the XML Forum of this site http://www.sqlservercentral.com/Forums/Forum21-1.aspx

    There should be at least one answer to your question in terms of splitting xmml into columns.

    If the issue is on how to get the XML file into a SQL variable to split it you might want to check for OPENROWSET in BOL.

    If you need a more detailed answer please provide addtl. information as described in the following article:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    Please attach XML sample data as txt file if required.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Search for how to use the Bulk and SINGLE_BLOB within Openrowset.. It will do it. You should get started from there...

    Hope it helps!

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

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