Export XML from SQL Server 2000
5 pts.
0
Q:
Export XML from SQL Server 2000
We currently use a DTS package to extract data from the db and export it in an XLS file, or in some cases a TXT file. We now need to be able to export as an XML file. Since SQL Server 2000 DTS functions do not appear to support this directly, can anyone give us guidance on how to proceed?
ASKED: Aug 18 2008  6:36 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
46795 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
The easiest way is to use the BCP command.

Take the SELECT command which will create the XML (either using the FOR XML AUTO or the FOR XML EXPLICIT commands) and put it within a stored procedure.

Use BCP and using the Query Out command give it the stored procedure name to run.

bcp "YourDatabase.dbo.YourProcedure" QUERYOUT "D:\YourFile.xml" ...
Last Answered: Aug 19 2008  3:02 PM GMT by Mrdenny   46795 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Mrdenny   46795 pts.  |   Aug 19 2008  3:03PM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 
0