xml file from sql server using bcp
Posted on 2011-02-18
I am trying to auto-generate xml file from sql server 2005 using bcp.
I have a stored procedure callled sp_Ap. I use "for xml auto, root("Iss"),elements" to get the required format.It generates the file fine.
My problem is when I try to generate it using bcp utility(I need to set it up to run automatically), it
only generates part of the file and error out in the middle.
This is what I used.
EXEC xp_cmdshell 'bcp "exec ErpLnX.dbo.sp_Ap" QUERYOUT \\va\users\L\Testing.xml -c -T'.
I checked the data and I don't see anything different on that line. Please help.
Errors getting :
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
End tag 'Sales' does not match the start tag 'SalesOrder'. Error processing resource 'file:///C:/Documents and Settings/lpo...