Click here to Skip to main content
15,907,001 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
CREATE DATABASE Data
CREATE TABLE Tables(Name varchar(25),Mobile int)

CREATE PROCEDURE spInsert
(
	@name varchar(25),
	@mobile int
)
AS
BEGIN
INSERT INTO Tables VALUES(@name,@mobile)
END

exec spInsert

it give error as:
Procedure or function 'spInsert' expects parameter '@name', which was not supplied.

how to run stored procedure?
Posted
Updated 27-Nov-12 8:05am
v4
Comments
Maksud Saifullah Pulak 30-Nov-12 3:30am    
You may add exec spInsert 'myname', 1

Where you have the

exec spInsert


You need to add your variables

exec spInsert 'myname', 1 
 
Share this answer
 
You have to pass some value to @name
Second thing: in create table query you have Tables and in INSERT you have table1
 
Share this answer
 
v2

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