Hi I am working in sql 2000 database and I want to retrieve a select statement and generate an xml. Everything goes perfect except the fact that I can't add a general root for the entire result from dhe generated xml. My code is like this:
SELECT FirstName , LastName
FROM Employees
FOR XML AUTO, ELEMENTS
and the result for this is
<Employees>
<FirstName>Nancy</FirstName>
<LastName>Davolio</LastName>
</Employees>
<Employees>
<FirstName>Andrew</FirstName>
<LastName>Fuller</LastName>
</Employees>
<Employees>
<FirstName>Janet</FirstName>
<LastName>Leverling</LastName>
</Employees>
<Employees>
<FirstName>Margaret</FirstName>
<LastName>Peacock</LastName>
</Employees>
but what I want is that this xml to look like this
<Table1>
<Employees>
<FirstName>Nancy</FirstName>
<LastName>Davolio</LastName>
</Employees>
<Employees>
<FirstName>Andrew</FirstName>
<LastName>Fuller</LastName>
</Employees>
<Employees>
<FirstName>Janet</FirstName>
<LastName>Leverling</LastName>
</Employees>
<Employees>
<FirstName>Margaret</FirstName>
<LastName>Peacock</LastName>
</Employees>
</Table1>
thanks for any advice. p.s. I meantioning again that im workin in sql 2000
Qendro