Tuesday, March 27, 2012

Export Data to XML Format

Hi,

What's the best way to export data from SQL Server to XML format. I've taken over a VB application written to carry out this task but it seems more complicated than it needs to be. Is it possible to just miss out VB and use say a DTS program instead??

I have been given a schema(XSD) file and as far as I'm aware any xml has to be formatted according to this schema.

Thanks
MattYou shouldn't re-invent XML by programming it; there are ton's of documentation how to use default functionality, see for example (including code) (http://www.winnetmag.com/SQLServer/Article/ArticleID/15854/15854.html)|||Thanks for the link. The VB program seems to be using ADO and DOM to generate the XML doc so think I will just leave it at that. The only improvement that I think could be made is to move the formatting of the XML doc to an XSLT stylesheet - at the moment the formatting is hard coded using VB...

No comments:

Post a Comment