Home All Groups Group Topic Archive Search About
Author
24 Jun 2006 1:25 PM
reachmano
Is there an option you can add to a sql query that would give me XML
output which also includes the datatype.

Example:

I would like the XML output to show

<property name="LinkNumber" type ="Integer">101</property>

I am able to get the XML output using "For XML" in the sql but it does
not display the "data type" field along with it.

It would be great if someone knows how this can be achieved.

Thank you

Author
25 Jun 2006 1:52 AM
oj
there isn't anything builtin. you will have to determine the datatype and
include it with your query.

--
-oj



<reachm***@gmail.com> wrote in message
Show quote
news:1151155504.104501.105920@p79g2000cwp.googlegroups.com...
> Is there an option you can add to a sql query that would give me XML
> output which also includes the datatype.
>
> Example:
>
> I would like the XML output to show
>
> <property name="LinkNumber" type ="Integer">101</property>
>
> I am able to get the XML output using "For XML" in the sql but it does
> not display the "data type" field along with it.
>
> It would be great if someone knows how this can be achieved.
>
> Thank you
>
Author
25 Jun 2006 11:09 AM
Omnibuzz
you may try using XMLDATA in your for XML clause. Though it does not exactly
address your requirements, it prepends the schema with the XML document.
--
-Omnibuzz (The SQL GC)

http://omnibuzz-sql.blogspot.com/

AddThis Social Bookmark Button