Scenario: When executed more than 325 columns in a select query the error bellow was thrown:
 Invalid operation. The connection is closed.
The same query with fewer columns than that worked. So it seems it was hitting some kind of limit.
Once we got the request after some troubleshooting we found the following error on the logs:
The service has encountered an error processing your request. Please try again. Error code 8632.
So it was not a matter of hard limit, but complexity and translation that may happen in any version of SQL Server.
I know this doc is SQL Server 2005, but the issue is the same. When the query is too complex it must be simplified. So SQL does not map de number of expressions directly. Using the doc words:
"This issue occurs because SQL Server limits the number of identifiers and constants that can be contained in a single expression of a query. This limit is 65,535. For example, the following query only has one expression:
select a, b + c, d + e
This expression retrieves all five columns, calculates the addition operators, and sends three projected results to the client."
The solution was simplified the query text. Some functions were added on Select statement, SQL query text was simplified and the query worked after that.
That is it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.