|
Hi folks, I am perplexed. After lots of searching, reading, mimicking the examples, I still have not successfully achieved the results. My query is simple: SELECT ProductLineCode, Description FROM tblProduct ORDER BY sortid FOR XML AUTO, ELEMENTS When the XML comes back, it has multiple root level elements. I am at a loss as to why and how to fix it. I would greatly appreciate any help. It is SQL 2000 SP 4. In addition, if anyone has any advice as to the next task I have: In a Windows Form app, there is a button that our network guy will press to synch current data in our SQL Server to an XML file and download it to a specific directory on a laptop computer. The higher priority though is trying to get the query above to not give me the multiple root level elements. Thank you in advance!
(comments are locked)
|
|
I think that is expected behaviour - FOR XML does return data with multiple top level elements. When I render out XML result sets in my apps, I always add a 'resultSet' root node which wraps the returned content. +1 - Yeah, that's my experience too. PS congrats on 6k now Matt. Looks like I'll never catch you!!
Feb 10 '10 at 06:14 PM
Fatherjack ♦♦
Yeah you will - I'm off contracting for 3 months on Monday - after spending 8 months on my products I need some money coming in! :)
Feb 10 '10 at 06:29 PM
Matt Whitfield ♦♦
(comments are locked)
|

