Import / Export Wizard XML file

  • Hi ,

    I want to import a XML file into a table to see some data.

    The import and export wizard does not offer the option XML (as source).

    What should I do? Choose Flat file as the sorce and point to XML file?

    Thanks.

  • Do you have to use the Import and export wizard it can be achived in a few lines of code, for example importing a xmlfile into a column of a table:

    INSERT INTO T(XmlCol)

    SELECT * FROM OPENROWSET(

    BULK 'c:\SampleFolder\SampleData3.txt',

    SINGLE_BLOB) AS x;

    taken from this article: http://technet.microsoft.com/en-us/library/ms191184.aspx

    Once imported to a coluns you can shred the data to columns or perform xquery commands on it etc.

    MCITP SQL 2005, MCSA SQL 2012

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

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