Creating an .xml file from a SQL Server 2000 database

  • I am new to SQL Server and have to select columns from a SQL Server 2000 table and create an .xml file of the selected columns.

    I am not sure of the syntax or the code I need to write to accomplish this.

    Any suggestions will be greatly appreciated.

  • I myself am on the same learning curve as you, though I have made good headway in my research. You could try these:

    [Code]SELECT Customers.CustomerID, Orders.OrderID, Orders.OrderDate

    FROM Customers, Orders

    WHERE Customers.CustomerID = Orders.CustomerID

    ORDER BY Customers.CustomerID

    [FOR XML [RAW | EXPLICIT]]

    OR

    [FOR XML AUTO, [XMLDATA]] [/Code]


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • Using this syntax

    i ma not able to load data to xml...

    _____________________________________________________________________________________________________________
    Paresh Prajapati
    ➡ +919924626601
    http://paresh-sqldba.blogspot.com/[/url]
    LinkedIn | Tweet Me | FaceBook | Brijj

  • Praja, do NOT "cut and paste" the code - it will definitely not work. Use only one of the options in brackets separated by "|".

    [Code]SELECT Customers.CustomerID, Orders.OrderID, Orders.OrderDate

    FROM Customers, Orders

    WHERE Customers.CustomerID = Orders.CustomerID

    ORDER BY Customers.CustomerID

    FOR XML [RAW | EXPLICIT | AUTO][/Code]

    Use BOL / Google to find out the precise features of each option.


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

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

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