In the SQL Server documentation, it says that if you use "for xml path('')" no wrapper will be generated for the data selected. But, I am trying to select an xml column from a table, and the syntax above does not allow me to get the result without it being wrapped in an element with the column's name. Here is my example:create table #t(id int, xmldata xml)insert into #t(id, xmldata) values(1, '<item>blah</item>');insert into #t(id, xmldata) values(2, '<item>something</item>');insert into #t(id, xmldata) values(3, '<item>yes</item>');insert into #t(id, xmldata) values(4, '<item>no</item>');insert into #t(id, xmldata) values(5, '<item>whatever</item>');select xmldatafrom #t where id < 100for xml path('')drop table #tthis returns<xmldata> <item>blah</item></xmldata><xmldata> <item>something</item></xmldata><xmldata> <item>yes</item></xmldata><xmldata> <item>no</item></xmldata><xmldata> <item>whatever</item></xmldata>
and I simply want<item>blah</item><item>something</item><item>yes</item><item>no</item><item>whatever</item>
This is a simple thing and I cannot figure out what I am doing wrong.(its late). thanks for any help you can provide.