Creating XML file using SQL Server 2005

5 pts.
Tags:
SQL Server 2005
SQL Server import/export
XML
How to create a xml file using sql server 2005? what are all the steps to do for this?

Answer Wiki

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

Create a stored procedure which contains the select statement you wish to use. Make sure that the select statements creates the XML data the way you want it using the FOR XML clause.

Then use BCP and use it to run the stored procedure using the QUERYOUT switch giving to the three part name to the stored procedure as well as the path to the file you wish to put the data into.

You can also do this with DTS (SQL 2000 and older) or SSIS (SQL 2005 and newer).

Discuss This Question: 1  Reply

 
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
  • Denny Cherry
    Denny Cherry has over a decade of experience managing SQL Server and is currently a Sr. Database Administrator and Architect at Awareness Technologies. Denny holds several Microsoft Certifications as well as being a Microsoft MVP.
    66,115 pointsBadges:
    report

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