Export XML from SQL Server 2000

5 pts.
Tags:
DTS packages
Microsoft SQL Server 2000
XML
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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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" ...

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following