Click here to Skip to main content
16,018,534 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi

i have a problem with my procedure

mt proc

SQL
USE [GLDB]
GO
/****** Object:  StoredProcedure [dbo].[ADM_GROUPInsert]    Script Date: 07/07/2013 12:53:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[ADM_GROUPInsert]
(
	@GROUP_ID int,
	@GROUP_NAME varchar(50)
)

AS

SET NOCOUNT ON

INSERT INTO [ADM_GROUPS]
(
	[GROUP_ID],
	[GROUP_NAME]

)
VALUES
(
	@GROUP_ID,
	@GROUP_NAME

)


and when i try to execute it get this error

SQL
Msg 201, Level 16, State 4, Procedure ADM_GROUPInsert, Line 0
Procedure or function 'ADM_GROUPInsert' expects parameter '@GROUP_ID', which was not supplied.

ant one help me
Posted
Comments
CHill60 7-Jul-13 7:17am    
Can you post the code that you are using to execute the SP - you're clearly not passing enough parameters to it
Darsh_Basha 7-Jul-13 7:28am    
right click and then execute procedure , write the group name and press ok

your code clearly states that it needs two parameters

@GROUP_ID
@GROUP_NAME

Group ID is in INT, as integer. Check it is autoincrement or not (in Column design), You have to pass it while inserting. or Make it as auto increment and you need to pass that as argument.

You have to run the query as

ADM_GROUPInsert 10 'GRP NME'

it will insert 10 in groupid and GRP NME in groupname columns.
 
Share this answer
 
The error message is pretty explicit:
Procedure or function 'ADM_GROUPInsert' expects parameter '@GROUP_ID', which was not supplied.
The problem is not in your code as shown - it has to do with how you call the procedure. When you do, you have not supplied the parameter!

We cannot help you to sort this by looking at the procedure - it needs a parameter supplied to work. Look at the code with which you call it!
 
Share this answer
 
Comments
Maciej Los 7-Jul-13 7:38am    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900