When a namespace is declared in your xml document / String and you will use the OpenXml in your stored Procedure / Sql Query, you will get this type of error. To remove this error you need to define the namespace while you write the EXECUTE statement in you query/stored procedure.
Suppose you have written the following statement:
EXEC sp_xml_preparedocument @docHandle OUTPUT, @XmlDoc
So you need to change it with the following one:
EXEC sp_xml_preparedocument @docHandle OUTPUT, @XmlDoc, ‘
’
Where ns0 is the namespace of your xmlDocument, which is defined in the first node of your xml document. Suppose my xml document is as follows:
Address_0
ID_0
Name_0
City_0
Let me know if you have any query:)
Regards,
Vijay Modi
No comments:
Post a Comment