SELECT FOR XML

  • Hi everybody!

    A silly question, but I can not go further!

    I have this statement

    USE Northwind

    SELECT Customers.CustomerID, ContactName, CompanyName, Orders.CustomerID, OrderDate

    FROM Customers, Orders

    WHERE Customers.CustomerID = Orders.CustomerID AND (Customers.CustomerID = N'ALFKI' OR Customers.CustomerID = N'XYZAA')

    FOR XML AUTO, ELEMENTS

    I'm trying to copy the result displayed in the Query Analyzer in the Grids Pane and paste it into a notepad file, so that I can see the result in IE. But when I copy the result, the xml file is not complete. You can try the example with the northwind database.

    Thank you very much!

    Radu

  • Get the results in text or better yet, run this from osql and pipe the results to a file. You will have the header, but that is easily deleted.

    Steve Jones

    steve@dkranch.net

  • You can try setting the Maximum characters per column to 8192 and see if that will do it. If not you will have to send the output to a text file as Steve suggested.

  • There is a trace flag for making it a little easier to read. I think 257. Been mentioned a couple times in the SQL Mag XML column.

    Andy

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

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