I'm trying to export an XML file from SQL server using this code that was made for me: ( SELECT ISNULL([NAME],'') AS 'NAME' FROM [NAMES] NA WHERE RT.[ID] = NA.[ID] FOR XML PATH('NAME'), ROOT ('NAMES'),TYPE ), It should look like this: *I purposely added spaces after the less than sign to show code here < NAMES>
< NAME>BOB< /NAME>
< NAME>ROBERT< /NAME>
< NAME>BOBBY< /NAME>
< /NAMES>
But it's exporting as: < NAMES>
< NAME>
< NAME>BOB< /NAME>
< /NAME>
< NAME>
< NAME>ROBERT< /NAME>
< /NAME>
< NAME>
< NAME>BOBBY
< /NAME>
< /NAMES>
Any help is greatly appreciated.