none
The incoming tabular data stream(TDS) remote procedure call (RPC) protocol stream is incorrect.Too many parameters provided in the RPC request.The maximum is 2100.

    Question

  • I'm hoping this is the right forum for this question.

    We have a large number of entities in the entity framework. Is there a maximum that we've exceeded? We're getting this error when trying to add a few more entities.

    An error occurred while executing the command definition. See the InnerException for details. The incoming tabular data stream(TDS) remote procedure call (RPC) protocol stream is incorrect.Too many parameters provided in the RPC request.The maximum is 2100."


    "I have no particular talent. I am merely inquisitive." -- Albert Einstein
    Friday, September 30, 2011 8:17 PM

Answers

  • this is a limitation of sql server. you only can solve this by redesign.

    http://msdn.microsoft.com/en-us/library/ms143432.aspx

    HTH

    Holger

    Saturday, October 01, 2011 11:16 AM

All replies

  • this is a limitation of sql server. you only can solve this by redesign.

    http://msdn.microsoft.com/en-us/library/ms143432.aspx

    HTH

    Holger

    Saturday, October 01, 2011 11:16 AM
  • So that means we have a stored proc with 2100 parameters? What exactly is causing the error that needs to be redesigned?

     I checked the model browser and the proc with the most parameters only has 68. There is one that returns XML of length MAX. Could that be the issue?

     


     

    "I have no particular talent. I am merely inquisitive." -- Albert Einstein


    Monday, October 03, 2011 12:18 PM
  • well i dont think you are using more than 2100 parameters. but maybe there is an issue with using arrays?

    here is a discussion about similar issues:

    http://stackoverflow.com/questions/1028547/too-many-parameters-were-provided-in-this-rpc-request-the-maximum-is-2100


    another blog entry can be found here:

    http://blogs.msdn.com/b/emeadaxsupport/archive/2009/09/01/how-to-fix-sql-error-too-many-parameters-were-provided-in-this-rpc-request.aspx

    holger

    Monday, October 03, 2011 12:24 PM
  • This is an entity framework project. I don't think we doing anything with Linq in this project.
    "I have no particular talent. I am merely inquisitive." -- Albert Einstein
    Monday, October 03, 2011 1:13 PM
  • OK to be clear this is what is happening. I update the entity framework with a new entity while running a sql trace. When I click save after the entity framework updates, there is a SQL statement that executes with around 1052 parameters. Below is a brief selection from the statement.

     

    ([Extent1].[SchemaName] LIKE @p1030) AND ([Extent1].[Name] LIKE @p1031)) OR (([Extent1].[CatalogName] LIKE @p1032) AND ([Extent1].[SchemaName] LIKE @p1033) AND ([Extent1].[Name] LIKE @p1034)) OR (([Extent1].[CatalogName] LIKE @p1035) AND ([Extent1].[SchemaName] LIKE @p1036) AND ([Extent1].[Name] LIKE @p1037)) OR (([Extent1].[CatalogName] LIKE @p1038) AND ([Extent1].[SchemaName] LIKE @p1039) AND ([Extent1].[Name] LIKE @p1040)) OR (([Extent1].[CatalogName] LIKE @p1041) AND ([Extent1].[SchemaName] LIKE @p1042) AND ([Extent1].[Name] LIKE @p1043)) OR (([Extent1].[CatalogName] LIKE @p1044) AND ([Extent1].[SchemaName] LIKE @p1045) AND ([Extent1].[Name] LIKE @p1046)) OR (([Extent1].[CatalogName] LIKE @p1047) AND ([Extent1].[SchemaName] LIKE @p1048) AND ([Extent1].[Name] LIKE @p1049)) OR (([Extent1].[CatalogName] LIKE @p1050) AND ([Extent1].[SchemaName] LIKE @p1051) AND ([Extent1].[Name] LIKE @p1052))
    )  AS [Project6]
    

     


    "I have no particular talent. I am merely inquisitive." -- Albert Einstein
    Monday, October 03, 2011 3:30 PM
  • Hi,

    You can use SQL Profiler Tool in SQL Server to track the T-SQL generated by EF provider to see if the parameters are bigger than 2100.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, October 05, 2011 6:39 AM
  • I did use profiler! The point is that the EF generates a query that will eventually exceed 2100 parameters if you add enough entities to it.
    "I have no particular talent. I am merely inquisitive." -- Albert Einstein
    Thursday, October 06, 2011 2:10 PM
  • Hi,

    Thanks for your feedback.

    I think you should follow @Holger's suggestion, Thanks for understanding.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, October 07, 2011 9:51 AM