Export SQL Server 2005 data into XML a file

  • Hello

    Does any one know how I can export data from sql server 2005 into a XML format which can then be fed into a web service?

  • Look up FOR XML in Books Online.

  • Checked could only find bulk export and import to and from XML files

  • I'm trying to do the same thing, and I can't find the information I need either. I'm anxious to see what responses you get.

  • You can use SSIS to easily export to XML...

    If that won't help, try using Import / Export Wizard in SSMS

  • Yeah, my mind went to SSIS, will have a go at it and post my findings here.

  • You can always use the BCP tool and wrap that into a batch file and then add an "Execute Process Task" to your package.

    bcp "Select * from dbo..table FOR XML RAW" queryout c:\temp\test.xml -Soc-db -Uuser -Ppassword -c -r -t

  • Try using BCP. It worked for me and I used the output to create a schema.

    Change -S to your server name, the -T is for as trusted connection.

    bcp "SELECT * FROM DealerEntry..Dealer FOR XM

    L RAW" queryout c:\myfile.xml -Syourserver -T -c -r -t

  • Maybe Spire.DataExport can help you to export SQL data into XML.

    And it releases the free data export component for customers to download. You can try to download to check if it is really useful.

Viewing 9 posts - 1 through 8 (of 8 total)

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