Quick and Dirty exporting XML using BCP

Last post on BCP tonight promiseĀ  . . .

There are *many* ways of exporting an XML file from SQL, adding the section in bold below to the select in a BCP command will create XML from the search results.

BCP "select * from table FOR XML AUTO,TYPE, ELEMENTS " QUERYOUT "C:\TEST.XML" -c -t -T -S server

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *