Hi! I use SELECT FOR XML RAW on MSSQL 2000.
I would like to be able to format the XML output so that instead of
having:
<row a="asd1"...>
<row a="asd2"...>
<row a="asd3"...>
I would get
<1 a="asd1"...>
<2 a="asd2"...>
<3 a="asd3"...>
or better yet be able to assign a specifc column value to replace
"row".
This is because I want to load the XML stream into LUA tables, and LUA
tables need unique indexes.
Thanks in advance.
Jeff Lambert
RAW mode in SQL2K generates elements with name 'row'. If you want to change
element name (custom name) you have to use EXPLICIT or AUTO (using aliases)
mode. In SQL 2005 you are able to give custom name with RAW clause.
/Patrick
"Jeff Lambert" <xradicalx@.gmail.com> wrote in message
news:f4f18e47.0410051032.ca9317d@.posting.google.co m...
> Hi! I use SELECT FOR XML RAW on MSSQL 2000.
> I would like to be able to format the XML output so that instead of
> having:
> <row a="asd1"...>
> <row a="asd2"...>
> <row a="asd3"...>
> I would get
> <1 a="asd1"...>
> <2 a="asd2"...>
> <3 a="asd3"...>
> or better yet be able to assign a specifc column value to replace
> "row".
> This is because I want to load the XML stream into LUA tables, and LUA
> tables need unique indexes.
> Thanks in advance.
> Jeff Lambert
|||Also note that <1 a="asd1"/> is not a well-formed XML element (names cannot
start with numbers).
If you want to generate something like <row1/><row2/> etc. you would need an
XSLT stylesheet that creates such elements and copies all the attributes
over.
What is LUA exactly?
Best regards
Michael
"Patrick Akerblom" <patrik.akerblom@.ontrax.se> wrote in message
news:%23m2N2x2qEHA.2900@.TK2MSFTNGP12.phx.gbl...
> RAW mode in SQL2K generates elements with name 'row'. If you want to
> change element name (custom name) you have to use EXPLICIT or AUTO (using
> aliases) mode. In SQL 2005 you are able to give custom name with RAW
> clause.
> /Patrick
> "Jeff Lambert" <xradicalx@.gmail.com> wrote in message
> news:f4f18e47.0410051032.ca9317d@.posting.google.co m...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment