473,883 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 13428
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@ea t_my_shorts_hot mail.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.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@ea t_my_shorts_hot mail.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP10.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@ea t_my_shorts_hot mail.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.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@ea t_my_shorts_hot mail.com> wrote in message
news:Ob******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP10.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@ea t_my_shorts_hot mail.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP14.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@ea t_my_shorts_hot mail.com> wrote in message
news:Ob******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP10.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@ea t_my_shorts_hot mail.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP15.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@ea t_my_shorts_hot mail.com> wrote in message
news:Ow******** ******@TK2MSFTN GP12.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@ea t_my_shorts_hot mail.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

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

Similar topics

2
2343
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. -------------------------------------REPY---------------------------------- Hi Maybe i wasn't clear. I want to dynamically check whether what the lowest date and the highest date is in the calendar table. The presented solutions has fixed dates and i don't want that. If i could store a global...
2
28621
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
4608
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 through an SqlCommand object, which accepts two input parameters which affect the query range. the problem she's experiencing is that with all input parameter values,
6
2572
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 and added in my C# code as follows: SqlParameter prmCustAcctID = cmd.CreateParameter(); prmCustAcctID.ParameterName = "@CustAcctID";
2
2648
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 maximum allowed is 8. In 2005, does this maximum number still exist? if so, is it still 8, or has the number been increased?
10
19769
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 doesnt seem to do much. So I'm now trying to use ADO instead (in the hope that ADO transactions will work), however I'm getting the above error. My initial searches havent turned up any suitable suggestions - there appear to be many reasons why...
5
12268
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 to the database. SQLSTATE=57030. Background: I created a linked server to DB2 8.1 database which called GRR_DB2Server. In my stored procedure p_FetchRawData, I need to read some data from this linked server GRR_DB2Server and insert them into
6
10718
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 = m_vScrollBar.Maximum; The scroll bar is set to start from the bottom.
5
8600
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 ( p_ORG_ID Varchar, p_YEAR Varchar, p_DATA_NOT_APPLICABLE_ADMNEXP Number, p_DATA_NOT_APPLICABLE_OPENENR Number, P_VALDN_EXCEPN_MSG varchar, p_RETVAL OUT NUMBER ...
0
9944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9797
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7977
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.