Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Procedure has too many arguments specified

Author  Topic 

gvd
Starting Member

21 Posts

Posted - 2005-08-19 : 10:38:27
Hi guys,
can someone please help me figure this out. I get this error every time i try to run a procedure. the procedure is listed below.


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function Insert_ApplicationForm_PersonalData has too many arguments specified.


CREATE PROCEDURE [Insert_ApplicationForm_PersonalData]
(
@SessionId [int],
@Surname [varchar](40) = ' ',
@FirstName [varchar](40) = ' ',
@MiddleName [varchar](40) = ' ',
@DateOfBirth [datetime] = '01-01-1900',
@PlaceOfBirth [varchar](50) = ' ',
@Sex [char](1) = ' ',
@Religion [varchar](15) = ' ',
@MaritalStatus [varchar](15) = ' ',
@PhoneNumber [varchar](20) = ' ',
@EmailAddress [varchar](50) = ' ',
@Nationality [varchar](100) = ' ',
@StateOfOrigin [varchar](50) = ' ',
@LGA [varchar](70) = ' ',
@HomeTown [varchar](70) = ' ',
@FormNumber [varchar](40) = ' ',
@CampusId [int] = 1
)
AS
INSERT INTO [PORTAL].[dbo].[ApplicationForm_PersonalData]
(
[SessionId],
[Surname],
[FirstName],
[MiddleName],
[DateOfBirth],
[PlaceOfBirth],
[Sex],
[Religion],
[MaritalStatus],
[PhoneNumber],
[EmailAddress],
[Nationality],
[StateOfOrigin],
[LGA],
[HomeTown],
[FormNumber],
[CampusId]
)
VALUES
(
ltrim(rtrim(@SessionId)),
ltrim(rtrim(@Surname)),
ltrim(rtrim(@FirstName)),
ltrim(rtrim(@MiddleName)),
ltrim(rtrim(@DateOfBirth)),
ltrim(rtrim(@PlaceOfBirth)),
ltrim(rtrim(@Sex)),
ltrim(rtrim(@Religion)),
ltrim(rtrim(@MaritalStatus)),
ltrim(rtrim(@PhoneNumber)),
ltrim(rtrim(@EmailAddress)),
ltrim(rtrim(@Nationality)),
ltrim(rtrim(@StateOfOrigin)),
ltrim(rtrim(@LGA)),
ltrim(rtrim(@HomeTown)),
ltrim(rtrim(@FormNumber)),
ltrim(rtrim(@CampusId))
)

RETURN @@ERROR

Kristen
Test

22859 Posts

Posted - 2005-08-19 : 10:56:43
Can you post the code you are executing the SProc with?

You haven't got too many parameters, right?

Kristen
Go to Top of Page

gvd
Starting Member

21 Posts

Posted - 2005-08-19 : 11:04:50
Here's the code that executes the STP

	execute @errCode = [dbo].[Insert_ApplicationForm_PersonalData] @SessionId, @Surname, @FirstName, @MiddleName, @DateOfBirth, @PlaceOfBirth, @Sex, @Religion, @MaritalStatus, @PhoneNumber, @EmailAddress, @Nationality, @State, @LGA, @HomeTown, @FormPrefix, @CampusId 
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-19 : 11:08:35
You've got @PlaceOfBirth, @Sex reversed, but other than that it looks to me like you have the right number of parameters.

Is it possible that the SProc on your server is an older "version" which had fewer parameters at the time?

sp_help 'Insert_ApplicationForm_PersonalData'

will give you a list of parameters of the actual SProc version that is available

Kristen
Go to Top of Page
   

- Advertisement -