Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 27-Nov-12 6:41am
Ashu6257
Edited 27-Nov-12 8:05am
v4
Comments
Maksud Saifullah Pulak at 30-Nov-12 3:30am
   
You may add exec spInsert 'myname', 1
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Where you have the
 
exec spInsert
 
You need to add your variables
 
exec spInsert 'myname', 1 
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You have to pass some value to @name
Second thing: in create table query you have Tables and in INSERT you have table1
  Permalink  
v2

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 1,588
1 OriginalGriff 528
2 Manas Bhardwaj 383
3 Damith Weerasinghe 330
4 Tadit Dash 315
0 Sergey Alexandrovich Kryukov 9,575
1 OriginalGriff 6,006
2 Peter Leow 4,500
3 Maciej Los 3,540
4 Abhinav S 3,513


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 27 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid