December 24, 2013 at 3:36 pm
I need to return all of the child values for linenumbers in a XML Document that is stored in a table.
My Schema has xsd:anyType for most of the columns.
When I run this query:
SELECT
line.value('(/lineNumber)', 'varchar(7)') as LineNumber
FROM dbo.tBrokerInstructions
CROSS APPLY XML_data.nodes('/brokerInstructions/brokerInstructionsLine') as Lines(line)
I get "XQuery [dbo.tBrokerInstructions.xml_data.value()]: Cannot atomize/apply data() on expression that contains type 'lineNumber' within inferred type 'element(lineNumber,#anonymous) *'"
Can I use the string function to get this to work?
Any help?
December 24, 2013 at 9:57 pm
I hacked a way using OPENXML. It wasn't pretty.
If I had loaded the XML to a variable would the bad schema still have stuck?
Thanks....
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy