If you’re getting error Msg 6855 in SQL Server that reads “Inline schema is not supported with FOR XML PATH“, it’s because you’re trying to add an inline schema to an XML document that you’re generating using PATH
mode with the FOR XML
clause.
As the message alludes to, PATH
mode doesn’t support the ability to create an inline schema when using the FOR XML
clause.
To fix this issue, either use a different mode to generate the XML with an inline schema (specifically, use either AUTO
or RAW
mode), or don’t generate an inline schema at all.
Continue reading →