none
Maximum Number of parameters to C# methods and SQL stored Procedures

    Question

  • Hi,

    Here is a general question?

    Could you please give me an idea about Maximum Number of parameters that can be passed to C# method

    And how about maximum number of parameters to MS SQL stored Procedures?

     


    -- - Sabarish Sundaram
    Friday, December 03, 2010 6:40 AM

Answers

  • Hi Sundaram,

    Thanks for your post.

    I find a link about server sql2000: http://msdn.microsoft.com/en-us/library/aa258259(SQL.80).aspx

    @parameter

    Is a parameter in the procedure. One or more parameters can be declared in a CREATE PROCEDURE statement. The value of each declared parameter must be supplied by the user when the procedure is executed (unless a default for the parameter is defined or the value is set to equal another parameter). A stored procedure can have a maximum of 2,100 parameters.

    Note  There is no limit on the maximum number of output parameters that can be of cursor data type.

    Have a nice day.

    Alan Chen


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to Microsoft All-In-One Code Framework to download or request code samples from Microsoft Community Team!
    • Proposed as answer by Cor LigthertMVP Tuesday, December 07, 2010 8:32 AM
    • Marked as answer by Sundaram S Tuesday, December 07, 2010 8:55 AM
    Tuesday, December 07, 2010 8:15 AM

All replies

  • C# doesn't define a maximum number of parameters.

    IL's ParamCount max value is 0x1FFFFFFF.

    I succesfully compiled an assembly with a method taking 10000 parameters and called it. Don't try it! It takes nearly forever to edit the source when it contains something like that method call.

    Friday, December 03, 2010 9:43 PM
  • Hi Sundaram,

    Thanks for your post.

    I find a link about server sql2000: http://msdn.microsoft.com/en-us/library/aa258259(SQL.80).aspx

    @parameter

    Is a parameter in the procedure. One or more parameters can be declared in a CREATE PROCEDURE statement. The value of each declared parameter must be supplied by the user when the procedure is executed (unless a default for the parameter is defined or the value is set to equal another parameter). A stored procedure can have a maximum of 2,100 parameters.

    Note  There is no limit on the maximum number of output parameters that can be of cursor data type.

    Have a nice day.

    Alan Chen


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to Microsoft All-In-One Code Framework to download or request code samples from Microsoft Community Team!
    • Proposed as answer by Cor LigthertMVP Tuesday, December 07, 2010 8:32 AM
    • Marked as answer by Sundaram S Tuesday, December 07, 2010 8:55 AM
    Tuesday, December 07, 2010 8:15 AM
  • Hi Chen,

     

    Thanks for your reply.


    -- - Sabarish Sundaram
    Tuesday, December 07, 2010 8:55 AM
  • Hi Sundaram,

     

    You are welcome, I am glad to help you.

     

    Have a nice day.

    Alan Chen.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to Microsoft All-In-One Code Framework to download or request code samples from Microsoft Community Team!
    Tuesday, December 07, 2010 9:00 AM