SQL存储过程中的错误 [英] Error in SQL stored procedure

查看:126
本文介绍了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


它给出错误为:
过程或函数"spInsert"需要未提供的参数"@name".


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

how to run stored procedure?

推荐答案

在哪里有

Where you have the

exec spInsert



您需要添加变量



You need to add your variables

exec spInsert ''myname'', 1 


您必须将一些值传递给@name
第二件事:在创建表查询中,您具有表,而在INSERT中,您具有table1
You have to pass some value to @name
Second thing: in create table query you have Tables and in INSERT you have table1


这篇关于SQL存储过程中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆