Re: Get data out of a table using a schema through select statement

Tech-Archive recommends: Speed Up your PC by fixing your registry



Shabam Gupta wrote:

I need to get the data out of multiple sql table joins in the form of xml using the schema. Is there a way to do that in the select statement.

Use FOR XML e.g.

SELECT columnlist
FROM table1
INNER JOIN table2
ON joincondition1
INNER JOIN table3
ON joincondition2
FOR XML AUTO

If your XML needs to meet a schema then you might need to use FOR XML PATH or FOR XML EXPLICIT to make sure you get the structure you want.

MSDN docs: <http://msdn2.microsoft.com/en-us/library/ms191268.aspx>
<http://msdn2.microsoft.com/en-us/library/ms178107.aspx>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.



Relevant Pages

  • Re: how to return xml document from a web service
    ... what specific XML you expect. ... If you have a schema that defines what you expect, ... The second issue with this approach is that XML is not a string. ... >> methods from the wire transport. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • my first Tck/Tk program... and an XML question
    ... program which takes an XML Schema file, ... a basic XML tree and allows the user to save it. ... proc open_schema { ...
    (comp.lang.tcl)
  • RE: Data Insertion
    ... >The physical database structure is already in place. ... >I can determine the XML file and whether it contains a schema. ... In this particular case XML Schema is used to create a DataSet schema (set ... you're probably wondering how it's possible to load XML without XML ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: GEDOM as a database format
    ... format for meaning, that is, structure. ... If at least a basic XML schema is agreed on and XML used in any fashion, ... mothers: the autosomal/X mother and the mitochondrial mother .. ...
    (soc.genealogy.computing)
  • [ANN] New XML Editor in Visual Studio 2005 Beta 1
    ... Full syntax coloring for all XML and DTD syntax. ... Intellisense based on any DTD, ... Schema picker dialog for overriding schemas used for validation, which is then remembered as a document property in your solution. ... Goto Definition command for navigating between elements and their associated DTD, XDR or XSD schema definitions. ...
    (microsoft.public.dotnet.xml)