Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help needed with insert stored procedure

Thread Tools

Help needed with insert stored procedure

sm2010 sm2010 is offline
Junior Member
Join Date: Mar 2010
Posts: 2
Hi All,

i am having problems trying to run an stored procedure. i have two tables, and the one contains the foreign key of the other and i created an insert statement to inser the data in both tables. Can anyone please help me in solving this problem.

Any help much appreciated. Thanks.

here is the stored procedure code:
ALTER PROCEDURE [dbo].[contractRoomDetails]

@Duration varchar(10),
@NoOfHours int,
@RoomNo nchar(6),
@Classroom varchar(3),
@Hall varchar(3),
@Date varchar(50),
@StartTime varchar(50),
@FinishTime varchar(50)

Set NoCount on
DECLARE @ContractID varchar(6)

INSERT INTO Contract (Duration, NoOfHours) VALUES (@Duration, @NoOfHours)

Select @ContractID=@@Identity

INSERT INTO RoomBooking (RoomNo, Classroom, Hall, Date, StartTime, FinishTime, ContractID) VALUES (@RoomNo, @Classroom, @Hall, @Date, @StartTime, @FinishTime, @ContractID)

and to test it i tried to put in these values:
exec contractRoomDetails 'cn14', '4months', '13', 'rm3', 'yes', 'no', '13/09/09', '2pm', '3pm'

BUT the error message i keep getting is :

Msg 8144, Level 16, State 2, Procedure contractRoomDetails, Line 0
Procedure or function contractRoomDetails has too many arguments specified.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
Problems with doing an SQL insert stored procedure EmJayEm ASP .Net 4 01-11-2005 08:44 PM
insert stored procedure nicholas ASP .Net 4 11-17-2004 04:08 PM
ASP / Stored Procedure SQL Insert Help Bill Kellaway ASP General 7 10-12-2003 06:15 PM
Win32 Extension ADO with SQL Server Problem to insert money datatype with a stored procedure Quinet, Joel Python 0 08-08-2003 08:13 AM