G
Guest
I have a table that has some data that is being read is a column with XML
data. It is typed 'text' and the server is running 2000 so I don't have an
option to type the column as XML. I would however like to use
ExecuteXmlReader but I get an exception indicating that the data must be XML.
How do I convince the client that it is XML data?
My current query looks like:
SELECT XMLSent FROM dbo.OutboundTable WHERE documentTransactionID=xxx AND
OrderNumber='yyy'
Right now I am doing ExecuteScalar to read the XML string in. It seems silly
to read in a large chunk of "string" data, pass it to a MemoryStream, build
an XmlReader, and then use that to build an XML document (specifically an
XPath document because I want to do some XPath searches on the data). If I
can get an XmlReader directly from the SQL query via ExecuteXmlReader it
seems more efficient. Is this possible with the data structured as I
indicated? I have looked at FOR XML but I have not had good luck yet.
Any suggestions?
Thank you.
Kevin
data. It is typed 'text' and the server is running 2000 so I don't have an
option to type the column as XML. I would however like to use
ExecuteXmlReader but I get an exception indicating that the data must be XML.
How do I convince the client that it is XML data?
My current query looks like:
SELECT XMLSent FROM dbo.OutboundTable WHERE documentTransactionID=xxx AND
OrderNumber='yyy'
Right now I am doing ExecuteScalar to read the XML string in. It seems silly
to read in a large chunk of "string" data, pass it to a MemoryStream, build
an XmlReader, and then use that to build an XML document (specifically an
XPath document because I want to do some XPath searches on the data). If I
can get an XmlReader directly from the SQL query via ExecuteXmlReader it
seems more efficient. Is this possible with the data structured as I
indicated? I have looked at FOR XML but I have not had good luck yet.
Any suggestions?
Thank you.
Kevin