更新生成两行
更新生成两行
我有一张只有一行的表格
表格1
____________________________________________ id_employee | month| year| score| nbr_month| ____________________________________________ 14 | 2 |2015 | 15 | 4 | ____________________________________________
我想要更新这一行的数据
所以我创建了一个存储过程
update table1 set score=10,nbr_month=4 where id_employee=14 and month=2 and year=2015
但是执行存储过程后,结果生成了另一行数据
____________________________________________ id_employee | month| year| score| nbr_month| ____________________________________________ 14 | 2 |2015 | 15 | 4 | 14 | 2 |2015 | 10 | 4 | ____________________________________________
请问问题出在哪里?
先行致谢。
存储过程如下:
ALTER proc [dbo].[update_score] @id_employee int, @score int, @nbr_month int, @month int, @year int as begin update table1 set score = @score ,nbr_month = @nbr_month where id_employee = id_employee and [month] = @month and [year] = @year end