Hi all,
Can anyone help me with a SQL query to get the following XMLs in result.
This is for SQL Server 2000
First XML
<TagA id="NR_2">
<TagB id="2">Factory</TagB>
<TagC>WASHINGTON</TagC>
<TagD>999999999</TagD>
<TagE id="123456">Other</TagE>
<TagF>
<TagG>COMPANY</TagG>
<TagH>0123</TagH>
</TagF>
</TagA>
Second XML
<TagA id="NR_3">
<TagB id="2">Factory</TagB>
<TagC>GEORGIA</TagC>
<TagD>GA</TagD>
<TagE id="123456">Other</TagE>
<TagF/>
</TagA>
Look at the FOR XML EXPLICIT functionality.
If you could provide us with some example table, we could probably help you
with the query.
Best regards
Michael
"Umar" <Umar@.discussions.microsoft.com> wrote in message
news:1F4BC4B9-186A-46D8-BFB0-BA0BD657B184@.microsoft.com...
> Hi all,
> Can anyone help me with a SQL query to get the following XMLs in result.
> This is for SQL Server 2000
> First XML
> <TagA id="NR_2">
> <TagB id="2">Factory</TagB>
> <TagC>WASHINGTON</TagC>
> <TagD>999999999</TagD>
> <TagE id="123456">Other</TagE>
> <TagF>
> <TagG>COMPANY</TagG>
> <TagH>0123</TagH>
> </TagF>
> </TagA>
>
>
> Second XML
> <TagA id="NR_3">
> <TagB id="2">Factory</TagB>
> <TagC>GEORGIA</TagC>
> <TagD>GA</TagD>
> <TagE id="123456">Other</TagE>
> <TagF/>
> </TagA>
>
Showing posts with label 2000first. Show all posts
Showing posts with label 2000first. Show all posts
Monday, March 12, 2012
Query to get XML in output (SQL Server 2000)
Hi all,
Can anyone help me with a SQL query to get the following XMLs in result.
This is for SQL Server 2000
First XML
<TagA id="NR_2">
<TagB id="2">Factory</TagB>
<TagC>WASHINGTON</TagC>
<TagD>999999999</TagD>
<TagE id="123456">Other</TagE>
<TagF>
<TagG>COMPANY</TagG>
<TagH>0123</TagH>
</TagF>
</TagA>
Second XML
<TagA id="NR_3">
<TagB id="2">Factory</TagB>
<TagC>GEORGIA</TagC>
<TagD>GA</TagD>
<TagE id="123456">Other</TagE>
<TagF/>
</TagA>Look at the FOR XML EXPLICIT functionality.
If you could provide us with some example table, we could probably help you
with the query.
Best regards
Michael
"Umar" <Umar@.discussions.microsoft.com> wrote in message
news:1F4BC4B9-186A-46D8-BFB0-BA0BD657B184@.microsoft.com...
> Hi all,
> Can anyone help me with a SQL query to get the following XMLs in result.
> This is for SQL Server 2000
> First XML
> <TagA id="NR_2">
> <TagB id="2">Factory</TagB>
> <TagC>WASHINGTON</TagC>
> <TagD>999999999</TagD>
> <TagE id="123456">Other</TagE>
> <TagF>
> <TagG>COMPANY</TagG>
> <TagH>0123</TagH>
> </TagF>
> </TagA>
>
>
> Second XML
> <TagA id="NR_3">
> <TagB id="2">Factory</TagB>
> <TagC>GEORGIA</TagC>
> <TagD>GA</TagD>
> <TagE id="123456">Other</TagE>
> <TagF/>
> </TagA>
>
Can anyone help me with a SQL query to get the following XMLs in result.
This is for SQL Server 2000
First XML
<TagA id="NR_2">
<TagB id="2">Factory</TagB>
<TagC>WASHINGTON</TagC>
<TagD>999999999</TagD>
<TagE id="123456">Other</TagE>
<TagF>
<TagG>COMPANY</TagG>
<TagH>0123</TagH>
</TagF>
</TagA>
Second XML
<TagA id="NR_3">
<TagB id="2">Factory</TagB>
<TagC>GEORGIA</TagC>
<TagD>GA</TagD>
<TagE id="123456">Other</TagE>
<TagF/>
</TagA>Look at the FOR XML EXPLICIT functionality.
If you could provide us with some example table, we could probably help you
with the query.
Best regards
Michael
"Umar" <Umar@.discussions.microsoft.com> wrote in message
news:1F4BC4B9-186A-46D8-BFB0-BA0BD657B184@.microsoft.com...
> Hi all,
> Can anyone help me with a SQL query to get the following XMLs in result.
> This is for SQL Server 2000
> First XML
> <TagA id="NR_2">
> <TagB id="2">Factory</TagB>
> <TagC>WASHINGTON</TagC>
> <TagD>999999999</TagD>
> <TagE id="123456">Other</TagE>
> <TagF>
> <TagG>COMPANY</TagG>
> <TagH>0123</TagH>
> </TagF>
> </TagA>
>
>
> Second XML
> <TagA id="NR_3">
> <TagB id="2">Factory</TagB>
> <TagC>GEORGIA</TagC>
> <TagD>GA</TagD>
> <TagE id="123456">Other</TagE>
> <TagF/>
> </TagA>
>
Subscribe to:
Posts (Atom)