We recently upgraded to VS 2012 (still targeting .net 4.0) so we could use the new model diagrams to support having a larger merged data model. We were able to merge our models by hand into one combined model and can use it without issue at runtime (402 tables with lots of associations).
However when I try to update the model from the database, the designer gets an error:
Error 3 An error occurred while executing the command definition. See the inner exception for details.
The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.
SQL Server (2008 r2) has a fixed limit of 2100 parameters that can be passed to a stored procedure. EF is using a call to sp_executesql where it is passing 2400 parameters. While debugging the exeception in visual studio, we saw may duplicates like using one parameter for each table for the catalog, the schema and the table name rather than reusing the catalog and schema parms (that alone would've kept the call under the limit). Here's an example (notice each SchemaName has a different parm for a value that can't be different since you don't support mutliple databases in the same edmx!):
WHERE (([Extent1].[CatalogName] LIKE @p0) AND ([Extent1].[SchemaName] LIKE @p1) AND ([Extent1].[Name] LIKE @p2)) OR
(([Extent1].[CatalogName] LIKE @p3) AND ([Extent1].[SchemaName] LIKE @p4) AND ([Extent1].[Name] LIKE @p5)) OR (([Extent1].
[CatalogName] LIKE @p6) AND ([Extent1].[SchemaName] LIKE @p7) AND ([Extent1].[Name] LIKE @p8)) OR (([Extent1].[CatalogName]
LIKE @p9) AND ([Extent1].[SchemaName] LIKE @p10) AND ([Extent1].[Name] LIKE @p11)) OR (([Extent1].[CatalogName] LIKE @p12)
AND ([Extent1].[SchemaName] LIKE @p13) AND ([Extent1].[Name] LIKE @p14)) OR (([Extent1].[CatalogName] LIKE @p15) AND
([Extent1].[SchemaName] LIKE @p16) AND ([Extent1].[Name] LIKE @p17)) OR (([Extent1].[CatalogName] LIKE @p18) AND ([Extent1].
[SchemaName] LIKE @p19) AND ([Extent1].[Name] LIKE @p20)) OR (([Extent1].[CatalogName] LIKE @p21) AND ([Extent1].
[SchemaName] LIKE @p22) AND ([Extent1].[Name] LIKE @p23)) OR (([Extent1].[CatalogName] LIKE @p24) AND ([Extent1].
[SchemaName] LIKE @p25) AND ([Extent1].[Name] LIKE @p26)) OR (([Extent1].[CatalogName] LIKE @p27) AND ([Extent1].
[SchemaName] LIKE @p28) AND ([Extent1].[Name] LIKE @p29)) OR (([Extent1].[CatalogName] LIKE @p30) AND ([Extent1].
[SchemaName] LIKE @p31) AND ([Extent1].[Name] LIKE @p32)) OR (([Extent1].[CatalogName] LIKE @p33) AND ([Extent1].
[SchemaName] LIKE @p34) AND ([Extent1].[Name] LIKE @p35)) OR (([Extent1].[CatalogName] LIKE @p36) AND ([Extent1].
[SchemaName] LIKE @p37) AND ([Extent1].[Name] LIKE @p38)) OR (([Extent1].[CatalogName] LIKE @p39) AND ([Extent1].
[SchemaName] LIKE @p40) AND ([Extent1].[Name] LIKE @p41)) OR (([Extent1].[CatalogName] LIKE @p42) AND ([Extent1].
[SchemaName] LIKE @p43) AND ([Extent1].[Name] LIKE @p44)) OR (([Extent1].[CatalogName] LIKE @p45) AND ([Extent1].
[SchemaName] LIKE @p46) AND ([Extent1].[Name] LIKE @p47)) OR (([Extent1].[CatalogName] LIKE @p48) AND ([Extent1].
See more on this post: http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/aafb63c4-61df-4d8d-9373-df78d6f7d686/
However when I try to update the model from the database, the designer gets an error:
Error 3 An error occurred while executing the command definition. See the inner exception for details.
The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.
SQL Server (2008 r2) has a fixed limit of 2100 parameters that can be passed to a stored procedure. EF is using a call to sp_executesql where it is passing 2400 parameters. While debugging the exeception in visual studio, we saw may duplicates like using one parameter for each table for the catalog, the schema and the table name rather than reusing the catalog and schema parms (that alone would've kept the call under the limit). Here's an example (notice each SchemaName has a different parm for a value that can't be different since you don't support mutliple databases in the same edmx!):
WHERE (([Extent1].[CatalogName] LIKE @p0) AND ([Extent1].[SchemaName] LIKE @p1) AND ([Extent1].[Name] LIKE @p2)) OR
(([Extent1].[CatalogName] LIKE @p3) AND ([Extent1].[SchemaName] LIKE @p4) AND ([Extent1].[Name] LIKE @p5)) OR (([Extent1].
[CatalogName] LIKE @p6) AND ([Extent1].[SchemaName] LIKE @p7) AND ([Extent1].[Name] LIKE @p8)) OR (([Extent1].[CatalogName]
LIKE @p9) AND ([Extent1].[SchemaName] LIKE @p10) AND ([Extent1].[Name] LIKE @p11)) OR (([Extent1].[CatalogName] LIKE @p12)
AND ([Extent1].[SchemaName] LIKE @p13) AND ([Extent1].[Name] LIKE @p14)) OR (([Extent1].[CatalogName] LIKE @p15) AND
([Extent1].[SchemaName] LIKE @p16) AND ([Extent1].[Name] LIKE @p17)) OR (([Extent1].[CatalogName] LIKE @p18) AND ([Extent1].
[SchemaName] LIKE @p19) AND ([Extent1].[Name] LIKE @p20)) OR (([Extent1].[CatalogName] LIKE @p21) AND ([Extent1].
[SchemaName] LIKE @p22) AND ([Extent1].[Name] LIKE @p23)) OR (([Extent1].[CatalogName] LIKE @p24) AND ([Extent1].
[SchemaName] LIKE @p25) AND ([Extent1].[Name] LIKE @p26)) OR (([Extent1].[CatalogName] LIKE @p27) AND ([Extent1].
[SchemaName] LIKE @p28) AND ([Extent1].[Name] LIKE @p29)) OR (([Extent1].[CatalogName] LIKE @p30) AND ([Extent1].
[SchemaName] LIKE @p31) AND ([Extent1].[Name] LIKE @p32)) OR (([Extent1].[CatalogName] LIKE @p33) AND ([Extent1].
[SchemaName] LIKE @p34) AND ([Extent1].[Name] LIKE @p35)) OR (([Extent1].[CatalogName] LIKE @p36) AND ([Extent1].
[SchemaName] LIKE @p37) AND ([Extent1].[Name] LIKE @p38)) OR (([Extent1].[CatalogName] LIKE @p39) AND ([Extent1].
[SchemaName] LIKE @p40) AND ([Extent1].[Name] LIKE @p41)) OR (([Extent1].[CatalogName] LIKE @p42) AND ([Extent1].
[SchemaName] LIKE @p43) AND ([Extent1].[Name] LIKE @p44)) OR (([Extent1].[CatalogName] LIKE @p45) AND ([Extent1].
[SchemaName] LIKE @p46) AND ([Extent1].[Name] LIKE @p47)) OR (([Extent1].[CatalogName] LIKE @p48) AND ([Extent1].
See more on this post: http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/aafb63c4-61df-4d8d-9373-df78d6f7d686/