Seaquel
SQL Server error code

SQL Server error 1086

SQL Server raises error 1086 at severity 16, which marks a problem with the query or data that you can correct.

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.
Msg1086
Severity16
Group1000–1999

Source: Database Engine events and errors