How to convert a CSV file into XML?

  • I have a large CSV file that I want to export into XML format. How can I do this using SSRS 2008 R2 and SSMS?

    I have many fields, but here is my final query:

    select * from TN_DataFeed

    FOR

    XML AUTO,TYPE, ELEMENTS ,ROOT('Provider')

    when i click onthe output from this, i get the error:

    TITLE: Microsoft SQL Server Management Studio

    ------------------------------

    Unable to show XML. The following error happened:

    Unexpected end of file while parsing Name has occurred. Line 1, position 2097154.

    One solution is to increase the number of characters retrieved from the server for XML data. To change this setting, on the Tools menu, click Options.

    but i believe my code is accruate because i don't get this error if I just query a small portion of this data by using the WHERE clause. Also, I have the schema file.

  • The query seems to be correct.

    But the problem description as well as the answer is there, too:

    One solution is to increase the number of characters retrieved from the server for XML data. To change this setting, on the Tools menu, click Options.

    Even how to change it, is described. So, what else are you looking for??

    What I don't understand though: What do you mean by "using SSRS 2008 R2 and SSMS"?



    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