Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

too many arguments - but they match Expand / Collapse
Author
Message
Posted Saturday, May 24, 2014 2:24 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 9:54 PM
Points: 52, Visits: 131
I am getting an error in a stored procedure saying too many arguments are specified. I am using a FormView in ASP.NET (VB.NET) on the web page. The parameters list matches exactly the parameters in the stored procedure. I can't understand what is wrong. In Visual FoxPro I could check the number of parameters that were actually passed to a procedure. I can't find an equivalent funtion in SQL Server. It was a great help in VFP years ago. I find it odd that I can't do the same thing in this "superior product".

<UpdateParameters>
<asp:Parameter Name="nProductID" Type="Int32" />
<asp:Parameter Name="cProductTitle" Type="String" />
<asp:Parameter Name="nCategory3D" Type="Byte" />
<asp:Parameter Name="nSecondaryCat" Type="Byte" />
<asp:Parameter Name="cReadMe" Type="String" />
<asp:Parameter Name="nNumberOfFiles" Type="Byte" />
<asp:Parameter Name="cLongDesc" Type="String" />
<asp:Parameter Name="nPrice" Type="Decimal" />
<asp:Parameter Name="nSalePrice" Type="Decimal" />
<asp:Parameter Name="nPercentOff" Type="Int32" />
<asp:Parameter Name="lOnSale" Type="Boolean" />
<asp:Parameter Name="lFreebie" Type="Boolean" />
<asp:Parameter DbType="Datetime" Name="dSaleStart" />
<asp:Parameter DbType="Datetime" Name="dSaleEnd" />
<asp:Parameter Name="cFeatures" Type="String" />
<asp:Parameter Name="cRequirements" Type="String" />
<asp:Parameter Name="nSoftwareRequirements" Type="Byte" />
<asp:Parameter Name="nDAZversion" Type="Byte" />
<asp:Parameter Name="nPoserVersion" Type="Byte" />
<asp:Parameter Name="nBryceVersion" Type="Byte" />
<asp:Parameter Name="nCarraraVersion" Type="Byte" />
<asp:Parameter Name="cOtherVersions" Type="String" />
<asp:Parameter Name="lShadersOnly" Type="Boolean" />
<asp:Parameter Name="cMarketingCredits" Type="String" />
<asp:Parameter Name="nModelRequired" Type="Byte" />
<asp:Parameter Name="cOtherModel" Type="String" />
<asp:Parameter Name="lUpdated" Type="Boolean" />
<asp:Parameter DbType="Datetime" Name="dUpdateDate" />
</UpdateParameters>

ALTER PROCEDURE [dbo].[MyUpdateCode] --not the actual name of the procedure
@nProductID int,
@cProductTitle varchar(75),
@nCategory3D tinyint,
@nSecondaryCat tinyint,
@cReadMe text,
@nNumberOfFiles tinyint,
@cLongDesc varchar(2000),
@nPrice decimal,
@nSalePrice decimal,
@nPercentOff int,
@lOnSale bit,
@lFreebie bit,
@dSaleStart datetime,
@dSaleEnd datetime,
@cFeatures text,
@cRequirements text,
@nSoftwareRequirements tinyint,
@nDAZversion tinyint,
@nPoserVersion tinyint,
@nBryceVersion tinyint,
@nCarraraVersion tinyint,
@cOtherVersions varchar(500),
@lShadersOnly bit,
@cMarketingCredits varchar(1000),
@nModelRequired tinyint,
@cOtherModel varchar(50),
@lUpdated bit,
@dUpdateDate datetime

AS
BEGIN

Help?

Dana
Post #1574287
Posted Sunday, May 25, 2014 1:28 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 10:11 AM
Points: 36,994, Visits: 31,513
Heh... Join the crowd... everyone always has some gripe when they have to make a change in what they're using. You being an ol' FoxPro user makes it even more difficult because it was a great product that they discontinued. I'm still griping because they took away the functionality that used to lie under the {f4} key and because they took away sp_MakeWebtask.

Anyway, using the built in Windows functionality of an {alt]{click}{drag} to copy one set next to another, I was able to quickly verify that you're correct... they do, indeed, match line for line.

<asp:Parameter Name="nProductID" Type="Int32" />              @nProductID int,
<asp:Parameter Name="cProductTitle" Type="String" /> @cProductTitle varchar(75),
<asp:Parameter Name="nCategory3D" Type="Byte" /> @nCategory3D tinyint,
<asp:Parameter Name="nSecondaryCat" Type="Byte" /> @nSecondaryCat tinyint,
<asp:Parameter Name="cReadMe" Type="String" /> @cReadMe text,
<asp:Parameter Name="nNumberOfFiles" Type="Byte" /> @nNumberOfFiles tinyint,
<asp:Parameter Name="cLongDesc" Type="String" /> @cLongDesc varchar(2000),
<asp:Parameter Name="nPrice" Type="Decimal" /> @nPrice decimal,
<asp:Parameter Name="nSalePrice" Type="Decimal" /> @nSalePrice decimal,
<asp:Parameter Name="nPercentOff" Type="Int32" /> @nPercentOff int,
<asp:Parameter Name="lOnSale" Type="Boolean" /> @lOnSale bit,
<asp:Parameter Name="lFreebie" Type="Boolean" /> @lFreebie bit,
<asp:Parameter DbType="Datetime" Name="dSaleStart" /> @dSaleStart datetime,
<asp:Parameter DbType="Datetime" Name="dSaleEnd" /> @dSaleEnd datetime,
<asp:Parameter Name="cFeatures" Type="String" /> @cFeatures text,
<asp:Parameter Name="cRequirements" Type="String" /> @cRequirements text,
<asp:Parameter Name="nSoftwareRequirements" Type="Byte" /> @nSoftwareRequirements tinyint,
<asp:Parameter Name="nDAZversion" Type="Byte" /> @nDAZversion tinyint,
<asp:Parameter Name="nPoserVersion" Type="Byte" /> @nPoserVersion tinyint,
<asp:Parameter Name="nBryceVersion" Type="Byte" /> @nBryceVersion tinyint,
<asp:Parameter Name="nCarraraVersion" Type="Byte" /> @nCarraraVersion tinyint,
<asp:Parameter Name="cOtherVersions" Type="String" /> @cOtherVersions varchar(500),
<asp:Parameter Name="lShadersOnly" Type="Boolean" /> @lShadersOnly bit,
<asp:Parameter Name="cMarketingCredits" Type="String" /> @cMarketingCredits varchar(1000),
<asp:Parameter Name="nModelRequired" Type="Byte" /> @nModelRequired tinyint,
<asp:Parameter Name="cOtherModel" Type="String" /> @cOtherModel varchar(50),
<asp:Parameter Name="lUpdated" Type="Boolean" /> @lUpdated bit,
<asp:Parameter DbType="Datetime" Name="dUpdateDate" /> @dUpdateDate datetime



I don't even know how to spell "ASP" but I did notice that some of the lines of ASP code have the Name and DBType attributes reversed and don't know if that would be the cause of the problem or not, but thought it might be worth mentioning just in case it is.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1574364
Posted Sunday, May 25, 2014 1:32 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 10:11 AM
Points: 36,994, Visits: 31,513
Again, I don't know ASP but if any of the parameters aren't populated, is ASP still smart enough to send all of the parameters?

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1574365
Posted Sunday, May 25, 2014 1:51 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 9:54 PM
Points: 52, Visits: 131
I don't think that it matters about the position in the parameter of the dbtype spec, but I'll check it out. It is ASP.NET. Classic ASP is quite a different animal. In any case, from what I know this error is indicating that more parameters were sent than the procedure has receptors for...but it is ambiguous. I really wish T-SQL had a function like PARAMETERS() in VFP. I could know for sure.

Anyone else have any thoughts? It's surprising that there was only one person replying in a time span of about 23 hours.

Dana
Post #1574366
Posted Sunday, May 25, 2014 2:01 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 9:54 PM
Points: 52, Visits: 131
I just swapped those two dbType attributes to the end like all the other type attributes in the parameters and it didn't make a difference.

Dana
Post #1574367
Posted Sunday, May 25, 2014 4:20 AM This worked for the OP Answer marked as solution


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 3:15 PM
Points: 1,908, Visits: 19,054
danaanderson (5/25/2014)


Anyone else have any thoughts? It's surprising that there was only one person replying in a time span of about 23 hours.



not sure what you expect from a volunteer forum..........???

anyways...I know nothing about ASP but a quick google came up with this and others like it on SO.

http://stackoverflow.com/questions/14712451/procedure-or-function-xyz-has-too-many-arguments-specified

it may help...may not.....


______________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
Post #1574374
Posted Sunday, May 25, 2014 9:33 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 10:11 AM
Points: 36,994, Visits: 31,513
danaanderson (5/25/2014)
I don't think that it matters about the position in the parameter of the dbtype spec, but I'll check it out. It is ASP.NET. Classic ASP is quite a different animal. In any case, from what I know this error is indicating that more parameters were sent than the procedure has receptors for...but it is ambiguous. I really wish T-SQL had a function like PARAMETERS() in VFP. I could know for sure.

Anyone else have any thoughts? It's surprising that there was only one person replying in a time span of about 23 hours.

Dana


Heh... it IS an SQL Server forum with a large number of people that live in the United states and you've asked an ASP question on a holiday weekend.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1574391
Posted Sunday, May 25, 2014 11:39 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:28 AM
Points: 7,139, Visits: 15,190
Have you tried look at the profiler session of the parameters being passed in? Also - have you made sure that there is in fact only ONE stored proc with that specific name (e.g. myuser.StoredProc and dbo.StoredProc)? If the ASP is using a specific user account it might not be using the default schema.

On profiler: start a session recording, then fire your ASP call at it - you should be able to see what it being passed in.



----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Post #1574403
Posted Sunday, May 25, 2014 11:48 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 9:54 PM
Points: 52, Visits: 131
J Livingston SQL (5/25/2014)
danaanderson (5/25/2014)


Anyone else have any thoughts? It's surprising that there was only one person replying in a time span of about 23 hours.



not sure what you expect from a volunteer forum..........???

anyways...I know nothing about ASP but a quick google came up with this and others like it on SO.

http://stackoverflow.com/questions/14712451/procedure-or-function-xyz-has-too-many-arguments-specified

it may help...may not.....


Well, what I expected was some responses...I see a lot of helpfulness here. That's why it was my first choice to post the question here.

Thank you, I did Google this issue...and saw some things at stackoverflow...but they weren't that one. many times when I go to that site I see things that aren't helpful, that are about different circumstances entirely, or even often have no replies at all. Once in a while I see something that is actually helpful to me. This one was that...it was exactly the answer! Thank you again!

Dana
Post #1574445
Posted Sunday, May 25, 2014 11:50 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 9:54 PM
Points: 52, Visits: 131
Jeff Moden (5/25/2014)
danaanderson (5/25/2014)
I don't think that it matters about the position in the parameter of the dbtype spec, but I'll check it out. It is ASP.NET. Classic ASP is quite a different animal. In any case, from what I know this error is indicating that more parameters were sent than the procedure has receptors for...but it is ambiguous. I really wish T-SQL had a function like PARAMETERS() in VFP. I could know for sure.

Anyone else have any thoughts? It's surprising that there was only one person replying in a time span of about 23 hours.

Dana


Heh... it IS an SQL Server forum with a large number of people that live in the United states and you've asked an ASP question on a holiday weekend.


Well, it was SQL Server that was throwing the error. I thought it was the best place to start looking...and asking. True, though, it is a holiday weekend and most are probably out firing up the barbie.

Dana
Post #1574447
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse