Seaquel
SQL Server error code

SQL Server error 9840

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

The statement failed because the number of rows passed to APPROX_PERCENTILE function exceeded an internal limit. Consider adding a GROUP BY expression or a predicate to reduce the number of rows being processed by APPROX_PERCENTILE, or consider using PERCENTILE function.
Msg9840
Severity16
Group9000–9999

Source: Database Engine events and errors