ALTER PROCEDURE [dbo].[uspDeleteBudgetInfo]
-- Add the parameters for the stored procedure here
(@StartGoodsAddress varchar,
@EndGoodsAddress varchar)
AS
BEGIN
delete from Finance_Finance
where StartGoodsAddress=StartGoodsAddress and EndGoodsAddress=EndGoodsAddress
END
这是我写的,但是执行结果却是删除表中的所有数据
如何使用存储过程语句删除表中的一行数据
答案:2 悬赏:40 手机版
解决时间 2021-03-07 08:59
- 提问者网友:刺鸟
- 2021-03-06 15:38
最佳答案
- 五星知识达人网友:梦中风几里
- 2021-03-06 16:21
ALTER PROCEDURE [dbo].[uspDeleteBudgetInfo]
(@StartGoodsAddress varchar,
@EndGoodsAddress varchar)
AS
BEGIN
delete from Finance_Finance
where StartGoodsAddress=@StartGoodsAddress and --看这里 变量 EndGoodsAddress=@EndGoodsAddress --看这里 变量
END
(@StartGoodsAddress varchar,
@EndGoodsAddress varchar)
AS
BEGIN
delete from Finance_Finance
where StartGoodsAddress=@StartGoodsAddress and --看这里 变量 EndGoodsAddress=@EndGoodsAddress --看这里 变量
END
全部回答
- 1楼网友:底特律间谍
- 2021-03-06 16:58
create proc 存储过程名
@id int
as
delete from 表名 where id=@id
go
exec 存储过程名 1 --这样就调用存储过程从表中删除了id记录为1的记录
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯