XML or CSV File as a Linked Server?

  • Is there any way to use an XML or CSV file as a Linked Server? Or at least pull the data they contain into a stored procedure on the fly. It would only be used as a read only data source.

    Any guidance would be much appreciated.

    Thanks,

    Jason

  • to load the content of an xml file you could use

    DECLARE @xml xml

    SET @xml = (SELECT * FROM OPENROWSET(

    BULK 'C:\temp\file.xml',

    SINGLE_BLOB) AS x)

    SELECT @xml

    For details please see "OPENROWSET (Transact-SQL)" in BOL. (BooksOnLine, the online help system installed together with your SQL server).



    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]

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

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