Subject:Best approach for generating XML from SQL 2005 tables- Annotated Schema Versus XQuery Author:Bijimon Manjaly Date:09 Jan 2008 02:40 PM Originally Posted: 09 Jan 2008 02:39 PM
I initially wanted to use Stylus studio to generate an "Annotated XSD" and write my own SQL (using combination of XPath Queries and FORXML Explicit) to generate the XML using stored procedures in SQL. Let us call this approach 1. You can read more about this at http://18.104.22.168/en-us/library/ms171870.aspx
Your documentation is guiding me to using DataDirect XQuery to directly map my relational tables to the XML output I want. And then deploying this as a Java component. Approach 2. My questions are
1) Can Stylus studio be used to create an "annotated XSD"- one that describes the source - table and field -of the individual elements
2) Is Java the only deployment option for approach 2 ? We are a microsoft shop- Can stylus Studio generate the code in c# or vb.net?
3) What would you recommend between approach 1 and 2
Subject:Best approach for generating XML from SQL 2005 tables- Annotated Schema Versus XQuery Author:Minollo I. Date:09 Jan 2008 03:01 PM
There is no doubt that we would suggest approach #2, using the DataDirect XQuery route; there is no doubt we may be biased, but the level of flexibility that using XQuery (and specifically an implementation like DataDirect XQuery) brings to the table is impressive. There are a few interesting examples centered around MySQL support in DataDirect XQuery on http://www.xquery.com/examples/mysql/ that can be reused almost verbatim when working on SQL Server.
That said, DataDirect XQuery is indeed a Java component; a .NET version of it is not currently available. The way other users are accessing DataDirect XQuery from their .NET application is typically through the Web Service interface - using typically an Apache Tomcat app server to expose DataDirect XQuery.
About your question #1, Stylus Studio allows you to edit your schemas the way you want, but it won't provide any automated/assisted mode for annotating schemas as required by SQL Server.