In debugging a problem the application is throwing the error:
Internal error: An expression services limit has been reached. Please look for potentially complex expressions in your query, and try to simplify them.
In tracing through where it happens, I found that it is happening when calling an SP that is updating only a few records. I saw comments related to this error being related to large where clauses or large volumes of data, but I can't understand why this error is happening in SQL 2019 for an SP that only updates a few records. The logic essentially does:
- Grab the information of the record into a temp table
- Create a new database record with that info
- Call another SP that returns a pre-formatted string
- Update the record with some other custom info later on
- Call another SP that is creating another singular record
That's all that it is doing, and I'm getting this error message and it is causing problems. Any thoughts?