Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query results to xml

Author  Topic 

Steve2106
Posting Yak Master

183 Posts

Posted - 2012-03-29 : 11:07:42
Hi There,

I am in need of your help once again.
I need to export data from my database to an xml file. Can that be done.

I would like to run a query in a stored procedure and write the results out to "c:\QueryResults.xml" in xml format.

Select FirstName, LastName, EmailAdd
FROM
ClientsTable

Don't know the next part to put to xml.

I would appreciate any help you can give.

Best Regards,



Steve

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-29 : 12:24:09
you can use bcp for that.
see
http://msdn.microsoft.com/en-us/library/aa337544.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -