问题描述
我插入udpate使用单个程序删除数据但我得到这种类型的错误我的表包含三个colums .. customerid name country
this是我的程序
i am insert udpate delete the data using single procedure but i am get an this type of error my table contain a three colums.. customerid name country
this is my procedure
alter procedure sp_customers_Add(@action varchar(10), @customerid int, @name varchar(20), @country varchar(20))
as
begin
if @action='SELECT'
begin
select customerid ,name ,country from customers
end
if @action='INSERT'
begin
insert into customers(name,country)values(@name,@country)
end
if @action='UPDATE'
begin
Update customers set name=@name,country=@country where customerid=@customerid
end
if @action='DELETE'
begin
Delete from customers where customerid=@customerid
end
end
请帮助我..
我尝试过:
过程或函数'sp_customers_Add'需要参数'@customerid',这是未提供的。
Please help me..
What I have tried:
Procedure or function 'sp_customers_Add' expects parameter '@customerid', which was not supplied.
推荐答案
Procedure or function 'sp_customers_Add' expects parameter '@customerid', which was not supplied.
您的程序已定义因为有四个参数,其中一个被称为 @customerid
但是当你从外部代码调用SP时,你没有为该参数提供值。
所以检查你的代码,并确保你:
1)提供四个参数值。
2)正确拼写参数名称。
3)提供的值不是 null
或 DBNull.Value
我们不能为你做那件事,我害怕!
Your procedure is defined as having four parameters, one of which is called @customerid
but when you call the SP from your external code you do not provide a value for that parameter.
So check your code, and make sure that you:
1) Provided four parameters with values.
2) Spelled the parameter name correctly.
3) Provided a value that isn't null
or DBNull.Value
We can't do that for you, I'm afraid!
这篇关于过程或函数'sp_customers_add'需要参数'@customerid',这是未提供的。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!