Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Making sql query output well formed xml

Author  Topic 

ruraldev
Starting Member

2 Posts

Posted - 2007-01-13 : 15:16:52
Can anyone help me with how to amend this query to output well formed xml, basically all it needs is a <root></root> wrapper.

SELECT distinct vehiclestate.Alias, Day, Month, Year, Longitude, Latitude, Street, City, Zip_Code, Speed, PC_Time
from vehiclestate
Inner Join (
Select Alias, Max(Date_Time) As Maxreport
From vehiclestate
Where Year = 2007
Group By Alias
) As A
On vehiclestate.Alias = A.Alias
And vehiclestate.Date_Time = A.Maxreport
For xml auto, elements

Thanks

Gordon

MohammedU
Posting Yak Master

145 Posts

Posted - 2007-01-13 : 20:00:52
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=9336
http://www.samspublishing.com/articles/article.asp?p=99813&rl=1
http://www.15seconds.com/issue/001102.htm


MohammedU
Go to Top of Page

weitzhandler
Yak Posting Veteran

64 Posts

Posted - 2009-03-12 : 10:59:26
Is there a way to create a root wrapper in along with AUTO or PATH???

Shimmy
Go to Top of Page
   

- Advertisement -