SQLXML or .NET

  • I was thrown head first into some XML development. I have fairly complex data structure (23 tables on 6 levels) that need to be exported as XML document, repeatedly as reports.

    I am evaluating the best approach. I have tried Stored Procedures with FOR XML AUTO but that is not capable of generating multiple nodes on the same level, only a linear tree. The EXPLICIT option would be a nightmare to code with 23 table and composite key relationships, plus I have read somewhere that its performance decreases as the query gets more complex.

    I have played with Dataset in .Net and it looks promising and fast but there are these wierd quirks - it adds code that I do not want, does not hide key fields that should not be in the final XML document, etc..

    Anybody has suggestions, recomendations?

    Thanks,

    Jakub

  • quote:


    I have fairly complex data structure (23 tables on 6 levels) that need to be exported as XML document, repeatedly as reports.

    I have played with Dataset in .Net and it looks promising and fast but there are these wierd quirks - it adds code that I do not want, does not hide key fields that should not be in the final XML document, etc..


    Using a .NET language like C# or VB.NET is always going to be more flexible than relying on SQL Server.

    While I've found AS XML to be a useful tool on occasion, I have also run into limitations with the way that it represents data.

    I can think of two ways to approach this:

    Take a dataset, serialize as XML, load it into an XML Document object, and use code to edit out the elements and nodes you want to drop.

    /or/

    Create an XSLT that converts the Dataset format into the format you want. Then, get your data as a dataset, serialize at XML, and apply the XSLT.

    Personally, I'd use the latter.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply