Answered by:

XML Value Method to return multiple records

Question

I am new in XML SQl i have created a schema with namespace in SQL 2005; I can return single records with the following query using table and column name; however, i do not understand how to return multiple (nodes) records from xml segments where there are
multiple (same) elements.

Here is the query which works with one record, when trying to declare the Namespace to use nodes get error

The schema is an HIPAA 837 schema with multiple elements ; Table name =
PATIENTTRAC_SUBMISSION_HISTORY; xml field = PATIENTTRAC_EDI_SUBMISSION

XQuery [PATIENTTRAC_SUBMISSION_HISTORY.PATIENTTRAC_EDI_SUBMISSION.value()]: 'text()' is not supported on simple typed or 'http://www.w3.org/2001/XMLSchema#anyType' elements, found 'element(CLAIM_x0020_Patient_x0020_Account_x0020_Number,xs:string)'.