Solved

MS SQL XML output

Posted on 2003-11-28
3
316 Views
Last Modified: 2013-11-23
Can someone show me how to dump a MS SQL2000 table structure and data into a XML file format?

Thanks.

Jammy
0
Comment
Question by:jlislo
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 125 total points
ID: 9840498
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
 

Author Comment

by:jlislo
ID: 9844420
I got the data in XML format. Is there any way to export the structure into XML? Thanks
0
 

Author Comment

by:jlislo
ID: 9844426
Sorry my fault, data and structure all in one XML file. Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now