Results 1 to 4 of 4

Thread: XML output.

  1. #1
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1

    Unanswered: XML output.

    OK, I'm starting up a project that requires an XML output format, which I haven't played around with before. My plan is to load the data into a schema which matches the XML format, and the run my queries with the FOR XML AUTO, ELEMENTS options.

    So first, any comments on the plan of attack?

    Second, how do I get the XML output in a clean enough format to read in, say, either Visual Studio or even Internet Explorer? The output comes out as a solid block, with no identing, which I guess the display utilities can deal with, but it also contains carriage returns and an odd header at the top (XML_F52E2B61-18A1-11d1-B105-00805F49916B), and the ubiquitous separation dashes (-------------------------------), and I'm having to manually fix these issues before I can display the XML in any reasonable format.

    Any tips/tricks on dealing with XML are appreciated.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Well, I got my output to display correctly by turning off the headers in my Query Analyzer options. But I'd still appreciate any comments or recommendations about working with XML output.

    For instance, is there a way to easily recreate a database schema from a sample XML data file? I was able to do this in Access through the import wizard, and I can port the resulting tables to SQL Server. But I'm wondering if I can do this in SQL Server directly through DTS or some other utility/method.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Aug 2003
    Location
    austin,tx
    Posts
    104
    I'm just starting to play with the XML support as well. You can cutnpaste the output to a .xml file and open that file up with a browser or XML editor (word).
    You can also set your server up to all HTTP queries and you can run the select statements from the browser.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Yeah, I'm reading Ken Henderson's Guru's Guide to SQL Server Stored Procedures, XML, and HTML, and just getting into executing queries in a browser. Definitely requires a paradigm shift from normalized data structures.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •