473,382 Members | 1,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Maximum number of parameters for a procedure

Hello,

I have a question regarding the maximum number of parameters that can be
passed to a procedure.

In VB 6 the max was 60.

What is the max for Dot Net?

please and thanks.

Leroy
Nov 21 '05 #1
11 13379
There is no maximum as far as I know.

However, if you are getting even close to passing 60 arguments to a method,
it's probably time to rethink the design of your app.

"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
Hello,

I have a question regarding the maximum number of parameters that can be
passed to a procedure.

In VB 6 the max was 60.

What is the max for Dot Net?

please and thanks.

Leroy

Nov 21 '05 #2
Leroy,
I don't know what the actual maximum number of parameters to a procedure is,
or if there is any "attainable" limit.

However! surely there is a logical maximum that one should observe!!

I find with more then a handful (3 or 4) of parameters that I seriously
consider using a Parameter Object!

http://www.refactoring.com/catalog/i...terObject.html

A benefit of introducing a parameter object, is the chance that some of the
behavior from your first class can be moved to the parameter class.

Of course methods that have ParamArray parameters can have 5 or more
parameters passed...

Hope this helps
Jay
"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
| Hello,
|
| I have a question regarding the maximum number of parameters that can be
| passed to a procedure.
|
| In VB 6 the max was 60.
|
| What is the max for Dot Net?
|
| please and thanks.
|
| Leroy
|
|
Nov 21 '05 #3
Thanks Marina.

The procedure is a creation of my dba and he's a little tempermental when it
comes to suggestions such as redesign.
I'm in the process of converting apps to dot net from vb 6 and this one is
on the list, but the current production copy has been modified to more than
60 parameters and hasn't been converted. I'm trying to determine if I should
expidite the conversion, or do some sort of work around.

Leroy

"Marina" <so*****@nospam.com> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
There is no maximum as far as I know.

However, if you are getting even close to passing 60 arguments to a
method, it's probably time to rethink the design of your app.

"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
Hello,

I have a question regarding the maximum number of parameters that can be
passed to a procedure.

In VB 6 the max was 60.

What is the max for Dot Net?

please and thanks.

Leroy


Nov 21 '05 #4
Are you talking about a SQL Server stored procedure, or a VB method? I am
not clear.

If this is about a stored procedure, then you are limited by what SQL Server
limits you to - in which case VB 6 and VB.NET would not be a factor at all.

If this is a VB method, then I dont' see why your DBA would be a factor
here.

But in my opinion, in either case, no procedure should have 60 arguments.

"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ob**************@tk2msftngp13.phx.gbl...
Thanks Marina.

The procedure is a creation of my dba and he's a little tempermental when
it comes to suggestions such as redesign.
I'm in the process of converting apps to dot net from vb 6 and this one is
on the list, but the current production copy has been modified to more
than 60 parameters and hasn't been converted. I'm trying to determine if I
should expidite the conversion, or do some sort of work around.

Leroy

"Marina" <so*****@nospam.com> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
There is no maximum as far as I know.

However, if you are getting even close to passing 60 arguments to a
method, it's probably time to rethink the design of your app.

"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
Hello,

I have a question regarding the maximum number of parameters that can be
passed to a procedure.

In VB 6 the max was 60.

What is the max for Dot Net?

please and thanks.

Leroy



Nov 21 '05 #5
Jay,

However! surely there is a logical maximum that one should observe!!

I find with more then a handful (3 or 4) of parameters that I seriously
consider using a Parameter Object!


My thought first as well, however thinking about the result after that do I
keep it with Marina's answer.

(I thought about writing it than as a kind of intermediate, however I did
not find even that the right answer. I assume that we do not much misagree
about this)

Or I shall oversee of course something.

:-)

Cor
Nov 21 '05 #6
The procedure is a wrapper for an oracle database procedure. We have a
program that generates our procedure code to use in our apps and that is
where the problem lies. The dba creates a "stub" for the database proc and
the program reads the stub and generates the proc for vb along with
parameters and data types for those parameters. The program usually works
fine, except in this case. The dba doesn't want to split the stub, therefore
our canned app creates a wrapper procedure with 60 + parameters.

I'll use a parameter array for the vb6 problem and use a parameter object
for the conversion to dot net.

thanks for your help

L

"Marina" <so*****@nospam.com> wrote in message
news:u8**************@TK2MSFTNGP14.phx.gbl...
Are you talking about a SQL Server stored procedure, or a VB method? I am
not clear.

If this is about a stored procedure, then you are limited by what SQL
Server limits you to - in which case VB 6 and VB.NET would not be a factor
at all.

If this is a VB method, then I dont' see why your DBA would be a factor
here.

But in my opinion, in either case, no procedure should have 60 arguments.

"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ob**************@tk2msftngp13.phx.gbl...
Thanks Marina.

The procedure is a creation of my dba and he's a little tempermental when
it comes to suggestions such as redesign.
I'm in the process of converting apps to dot net from vb 6 and this one
is on the list, but the current production copy has been modified to more
than 60 parameters and hasn't been converted. I'm trying to determine if
I should expidite the conversion, or do some sort of work around.

Leroy

"Marina" <so*****@nospam.com> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
There is no maximum as far as I know.

However, if you are getting even close to passing 60 arguments to a
method, it's probably time to rethink the design of your app.

"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
Hello,

I have a question regarding the maximum number of parameters that can
be passed to a procedure.

In VB 6 the max was 60.

What is the max for Dot Net?

please and thanks.

Leroy



Nov 21 '05 #7
Thanks,

I'm going to follow the parameter array route to fix this problem and use a
parameter object when converting the app to dot net.

Leroy

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
Leroy,
I don't know what the actual maximum number of parameters to a procedure
is,
or if there is any "attainable" limit.

However! surely there is a logical maximum that one should observe!!

I find with more then a handful (3 or 4) of parameters that I seriously
consider using a Parameter Object!

http://www.refactoring.com/catalog/i...terObject.html

A benefit of introducing a parameter object, is the chance that some of
the
behavior from your first class can be moved to the parameter class.

Of course methods that have ParamArray parameters can have 5 or more
parameters passed...

Hope this helps
Jay
"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP12.phx.gbl...
| Hello,
|
| I have a question regarding the maximum number of parameters that can be
| passed to a procedure.
|
| In VB 6 the max was 60.
|
| What is the max for Dot Net?
|
| please and thanks.
|
| Leroy
|
|

Nov 21 '05 #8
"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> schrieb:
I have a question regarding the maximum number of parameters that can be
passed to a procedure.

In VB 6 the max was 60.

What is the max for Dot Net?


The maximum is rather irrelevant, because no sane person would design a
method with more than "a few" parameters because of usability issues arising
from a large number of parameters.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #9
With regard to the tempermental DBA tell him that his job is to
administer the database, not define your client application
architecture. He should not be in the business of mandating how you
call stored procedures.

There is no excuse for passing 60 arguments to a method, or a single
stored procedure for that matter. In fact, even storing 60 fields in
a single table is usually indicative of a non-normalized database, so
it sounds like he is trying to force you to plod forward and further
exacerbate what is already a flawed database design.

It behooves us as developers to push back on this type of nonsense.
Go over his head if you have to... get him fired if you have to.

Understanding the root cause of a problem is the first step to solving
it. Your problem is not the limit imposed by VB or DotNet. Your
problem is a DBA on crack.
Nov 21 '05 #10
Leroy,
Using the following System.CodeDom, I was able to generate routines with
32768 & 65536 parameters each. However VS.NET 2003's IDE really didn't like
the routine, although I did not receive any compile errors...

Imports System.CodeDom

Dim member As New CodeMemberMethod
member.Attributes = MemberAttributes.Public Or
MemberAttributes.Final
member.Name = "ExcessiveParameters"
For index As Integer = 1 To 32 * 1024
Dim parameter As New
CodeParameterDeclarationExpression(GetType(String) , "Parm" & index)
member.Parameters.Add(parameter)
Next
type.Members.Add(member)

I suspect the actual limit is line length within the IDE and/or compiler,
rather then actual number of parameters...

Post if you would like a more complete sample of the above CodeDom code.

I would recommend the SYstem.CodeDom namespace for your program that
generates your procedure code...

Hope this helps
Jay

"Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
news:OH**************@TK2MSFTNGP10.phx.gbl...
| The procedure is a wrapper for an oracle database procedure. We have a
| program that generates our procedure code to use in our apps and that is
| where the problem lies. The dba creates a "stub" for the database proc and
| the program reads the stub and generates the proc for vb along with
| parameters and data types for those parameters. The program usually works
| fine, except in this case. The dba doesn't want to split the stub,
therefore
| our canned app creates a wrapper procedure with 60 + parameters.
|
| I'll use a parameter array for the vb6 problem and use a parameter object
| for the conversion to dot net.
|
| thanks for your help
|
| L
|
| "Marina" <so*****@nospam.com> wrote in message
| news:u8**************@TK2MSFTNGP14.phx.gbl...
| > Are you talking about a SQL Server stored procedure, or a VB method? I
am
| > not clear.
| >
| > If this is about a stored procedure, then you are limited by what SQL
| > Server limits you to - in which case VB 6 and VB.NET would not be a
factor
| > at all.
| >
| > If this is a VB method, then I dont' see why your DBA would be a factor
| > here.
| >
| > But in my opinion, in either case, no procedure should have 60
arguments.
| >
| > "Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
| > news:Ob**************@tk2msftngp13.phx.gbl...
| >> Thanks Marina.
| >>
| >> The procedure is a creation of my dba and he's a little tempermental
when
| >> it comes to suggestions such as redesign.
| >> I'm in the process of converting apps to dot net from vb 6 and this one
| >> is on the list, but the current production copy has been modified to
more
| >> than 60 parameters and hasn't been converted. I'm trying to determine
if
| >> I should expidite the conversion, or do some sort of work around.
| >>
| >> Leroy
| >>
| >> "Marina" <so*****@nospam.com> wrote in message
| >> news:uV**************@TK2MSFTNGP10.phx.gbl...
| >>> There is no maximum as far as I know.
| >>>
| >>> However, if you are getting even close to passing 60 arguments to a
| >>> method, it's probably time to rethink the design of your app.
| >>>
| >>> "Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
| >>> news:Ow**************@TK2MSFTNGP12.phx.gbl...
| >>>> Hello,
| >>>>
| >>>> I have a question regarding the maximum number of parameters that can
| >>>> be passed to a procedure.
| >>>>
| >>>> In VB 6 the max was 60.
| >>>>
| >>>> What is the max for Dot Net?
| >>>>
| >>>> please and thanks.
| >>>>
| >>>> Leroy
| >>>>
| >>>
| >>>
| >>
| >>
| >
| >
|
|
Nov 21 '05 #11
Playing with this a little more, 32768 did not give any compile errors.

65536 caused the compiler to throw an exception...

Of course if you really have 32768 parameters, you really *really* should
review your design ;-)

Jay

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
| Leroy,
| Using the following System.CodeDom, I was able to generate routines with
| 32768 & 65536 parameters each. However VS.NET 2003's IDE really didn't
like
| the routine, although I did not receive any compile errors...
|
| Imports System.CodeDom
|
| Dim member As New CodeMemberMethod
| member.Attributes = MemberAttributes.Public Or
| MemberAttributes.Final
| member.Name = "ExcessiveParameters"
| For index As Integer = 1 To 32 * 1024
| Dim parameter As New
| CodeParameterDeclarationExpression(GetType(String) , "Parm" & index)
| member.Parameters.Add(parameter)
| Next
| type.Members.Add(member)
|
| I suspect the actual limit is line length within the IDE and/or compiler,
| rather then actual number of parameters...
|
| Post if you would like a more complete sample of the above CodeDom code.
|
| I would recommend the SYstem.CodeDom namespace for your program that
| generates your procedure code...
|
| Hope this helps
| Jay
|
| "Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
| news:OH**************@TK2MSFTNGP10.phx.gbl...
|| The procedure is a wrapper for an oracle database procedure. We have a
|| program that generates our procedure code to use in our apps and that is
|| where the problem lies. The dba creates a "stub" for the database proc
and
|| the program reads the stub and generates the proc for vb along with
|| parameters and data types for those parameters. The program usually works
|| fine, except in this case. The dba doesn't want to split the stub,
| therefore
|| our canned app creates a wrapper procedure with 60 + parameters.
||
|| I'll use a parameter array for the vb6 problem and use a parameter object
|| for the conversion to dot net.
||
|| thanks for your help
||
|| L
||
|| "Marina" <so*****@nospam.com> wrote in message
|| news:u8**************@TK2MSFTNGP14.phx.gbl...
|| > Are you talking about a SQL Server stored procedure, or a VB method? I
| am
|| > not clear.
|| >
|| > If this is about a stored procedure, then you are limited by what SQL
|| > Server limits you to - in which case VB 6 and VB.NET would not be a
| factor
|| > at all.
|| >
|| > If this is a VB method, then I dont' see why your DBA would be a factor
|| > here.
|| >
|| > But in my opinion, in either case, no procedure should have 60
| arguments.
|| >
|| > "Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
|| > news:Ob**************@tk2msftngp13.phx.gbl...
|| >> Thanks Marina.
|| >>
|| >> The procedure is a creation of my dba and he's a little tempermental
| when
|| >> it comes to suggestions such as redesign.
|| >> I'm in the process of converting apps to dot net from vb 6 and this
one
|| >> is on the list, but the current production copy has been modified to
| more
|| >> than 60 parameters and hasn't been converted. I'm trying to determine
| if
|| >> I should expidite the conversion, or do some sort of work around.
|| >>
|| >> Leroy
|| >>
|| >> "Marina" <so*****@nospam.com> wrote in message
|| >> news:uV**************@TK2MSFTNGP10.phx.gbl...
|| >>> There is no maximum as far as I know.
|| >>>
|| >>> However, if you are getting even close to passing 60 arguments to a
|| >>> method, it's probably time to rethink the design of your app.
|| >>>
|| >>> "Leroy" <leroy_lemon@eat_my_shorts_hotmail.com> wrote in message
|| >>> news:Ow**************@TK2MSFTNGP12.phx.gbl...
|| >>>> Hello,
|| >>>>
|| >>>> I have a question regarding the maximum number of parameters that
can
|| >>>> be passed to a procedure.
|| >>>>
|| >>>> In VB 6 the max was 60.
|| >>>>
|| >>>> What is the max for Dot Net?
|| >>>>
|| >>>> please and thanks.
|| >>>>
|| >>>> Leroy
|| >>>>
|| >>>
|| >>>
|| >>
|| >>
|| >
|| >
||
||
|
|
Nov 21 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message....
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
6
by: jason | last post by:
hello everyone, one of my developers is working with a DataGrid component, which uses a DataTable as its DataSource. the DataTable is populated by a method which calls a stored procedure...
6
by: Alex | last post by:
Hi... I have a stored procedure that takes in a large number of parameters (around 30) and returns (as output parameters) another 10 or so. At the moment, each parameter is declared, defined...
2
by: Michael.Suarez | last post by:
In MS Sql Server 2000, if you run a stored procedure that query's more than 8 databases, you get this error gets raised: Maximum number of databases used for each query has been exceeded. The...
10
by: CJM | last post by:
I'm trying to call a package/procedure in oracle (from an ASP page) which requires a number of parameters. I have got this working using OO40 but unfortunately the transaction rollback function...
5
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the VScrollBar and set it as follow: m_vScrollBar.Minimum = -19602; m_vScrollBar.Maximum = 0; m_vScrollBar.SmallChange = 1; m_vScrollBar.LargeChange = 1089; m_vScrollBar.Value =...
5
by: kaushal30 | last post by:
I am getting this error when I call a stored procedure from my C# code. It is a simple stored procedure with six params that inserts data : PROCEDURE LHD_SUR_ADMNEXP_HDR_INS ( ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.