SQL Server, getting “for xml” value

bijju

New Member
I think this one's pretty straightforward, but I can't seem to find it answered.I'm running a query on SQL Server 2005 with \[code\]for xml, elements\[/code\] at the end to return the result as XML. \[code\]select top 10 title, pubdate, description, linkfrom rssfeed itemfor xml auto, elements\[/code\]I'm running the query from a classic ASP page. Normally to get the results from a column, I'd use \[code\]rs.Fields.Item("colName")\[/code\]. The problem is, with \[code\]for xml\[/code\], the column name is a long string like \[code\]XML_F52E2B61-...\[/code\]. I tried \[code\]rs.Fields(0).value\[/code\]. That weirdly returned the names of the columns in the query separated by question marks, not the XML. My output is:\[code\]?title?pubdate?description?link?item?L???\[/code\]I tested my query in Management Studio, and the XML looks alright. Is there a way to read this value into classic ASP?
 
Back
Top