Solved

MS SQL XML output

Posted on 2003-11-28
3
323 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…

710 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