In this blog post, let’s learn about the error message “1086 – The FOR XML and FOR JSON clauses are invalid in views, inline functions, derived tables, and subqueries when they contain a set operator. To work around, wrap the SELECT containing a set operator using derived table or common table expression or view and apply FOR XML or FOR JSON on top of it.” in Microsoft SQL Server, the reason why it appears and the solution to fix it.
SQL Server Error Message
1086 – The FOR XML and FOR JSON clauses are invalid in views, inline functions, derived tables, and subqueries when they contain a set operator. To work around, wrap the SELECT containing a set operator using derived table or common table expression or view and apply FOR XML or FOR JSON on top of it.
Reason for the Error
To be update soon…
Solution
To be update soon…