Posted by Erland Sommarskog on 11/18/07 23:03
Matthew Butler (matthew.butler@srjdebt.co.uk) writes:
> can someone please advise me on the correct syntax to bcp export
> executing a stored procedures results to xml
>
> I know it begins
>
> bcp "exe sp_procedure" queryout
>
> but unser on the rest of the syntax
I'm not really sure what you have in mind. To start with the procedure
must return XML data, either with FOR XML or the xml data type. And I
don't really think that FOR XML works that well with BCP, at least not
for larger documents.
What does your procedure look like? Which version of SQL Server are you
using?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|