Hi, I am creating an MVC 4 report and using EF5. The database is on SQL 2005.
The report has a large number of long string filters, when there are many, I got this error: "Some of your SQL statement is nested too deep. Rewrite the query or split it into smaller queries."
Filters are selected and return a list, and in a LINQ query, I use:
DataContext.Entity.Where(list.Contains(column)); return IQueryable<Entity>;
I assume that the SQL query generated by LINQ has exceeded the limit, and I do not know what the limit is.
Is there any way to control this limit? or please indicate if my assumption was wrong.
Thank you very much.
Thanks for the link below provided by @AdrianFaciu, and it is really useful, I think this is a similar problem. (I think the length of each filter line is too long, and there are many). Reaching parameter limit 2100 (SQL Server) when using Contains ()
I read a few workarounds, but still looking for a suitable solution, and not by generating string queries. It seems, at least for now, that I should download the data step by step to reduce the length of the request.
source share