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, ‘<root xmlns:ns0=”http://vijaymodi.wordpress.com” />’
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:
<ns0:root xmlns:ns0=”http://vijaymodi.wordpress.com”>
<ID>ID_0</ID>
<NAME>Name_0</NAME>
<Address>Address_0</Address>
<City>City_0</City>
</ns0:root>
Let me know if you have any query:)
Cheers,
Vijay Modi