bcp to xml

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

many thanks
Matthew Butler [ So, 18 November 2007 17:11 ] [ ID #1873591 ]

Re: bcp to xml

Matthew Butler (matthew.butler [at] 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 [at] sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx
Erland Sommarskog [ Mo, 19 November 2007 00:03 ] [ ID #1873596 ]
Datenbanken » comp.databases.ms-sqlserver » bcp to xml

Vorheriges Thema: Can we update View
Nächstes Thema: Beginner question, stored procedure