• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

MS SQL XML output

Can someone show me how to dump a MS SQL2000 table structure and data into a XML file format?

Thanks.

Jammy
0
jlislo
Asked:
jlislo
  • 2
1 Solution
 
Mohammed NasmanSoftware DeveloperCommented:
Hello

  The Ado components allow to save the data as example, drop AdoDataset components and set the connectionstring property to use the northwind database, the write this code, it will save the structure and data in xml file

  adodataset1.CommandText := 'select * from customers';
  adodataset1.Open;
  Adodataset1.SaveToFile('c:\test.xml',pfXML);

also the TClientDataset allow the data to saved as xml, you can add DataSetProivder to connect to the AdoDataset, and ClientDataset and connect to the DatasetProvider and add this line
  ClientDataSet1.SaveToFile('c:\test1.xml',dfXMLUTF8);

Regards,
Mohammed
0
 
jlisloAuthor Commented:
I got the data in XML format. Is there any way to export the structure into XML? Thanks
0
 
jlisloAuthor Commented:
Sorry my fault, data and structure all in one XML file. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now