Home > Archive > MS SQL XML > July 2005 > Turn value into element name, how?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Turn value into element name, how?
Art

2005-07-09, 8:23 pm

I have a small table with two columns Var_Name and Var_Value. How can I write
SQL so that I have results returned to me in XML format like this:

< IwantToSpecifyThisPa
rentTag-How?>
<ValueOfVar_Name>ValueOfVar_Value</ValueOfVar_Name>
<ValueOfVar_Name>ValueOfVar_Value</ValueOfVar_Name>
<ValueOfVar_Name>ValueOfVar_Value</ValueOfVar_Name>
</ IwantToSpecifyThisPa
rentTag-How?>

I'd like variable name to be element name and varlable value to be that
element's value. How can I do this?
Bertan ARI [MSFT]

2005-07-11, 8:24 pm

I assume that you are using SqlXml3 Sp3 and annotated XSD technology.

Unfortunately by using Annotated XSD, you cannot perform such mapping.

--
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.



"Art" <Art@discussions.microsoft.com> wrote in message
news:2FFA04E7-A3BF-4B60-95F6- 8D5FCE42A7C4@microso
ft.com...
>I have a small table with two columns Var_Name and Var_Value. How can I
>write
> SQL so that I have results returned to me in XML format like this:
>
> < IwantToSpecifyThisPa
rentTag-How?>
> <ValueOfVar_Name>ValueOfVar_Value</ValueOfVar_Name>
> <ValueOfVar_Name>ValueOfVar_Value</ValueOfVar_Name>
> <ValueOfVar_Name>ValueOfVar_Value</ValueOfVar_Name>
> </ IwantToSpecifyThisPa
rentTag-How?>
>
> I'd like variable name to be element name and varlable value to be that
> element's value. How can I do this?



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com