I have a table that have 1 row table 1
____________________________________________
id_employee | month| year| score| nbr_month|
____________________________________________
14 | 2 |2015 | 15 | 4 |
____________________________________________
and i Want update this row so I created i stored procedure
update table 1
set score=10,nbr_month=4
where id_employee=14 and month=2 and year=2015
but the result of the excution of Stored Procedure generate another row
____________________________________________
id_employee | month| year| score| nbr_month|
____________________________________________
14 | 2 |2015 | 15 | 4 |
14 | 2 |2015 | 10 | 4 |
____________________________________________
So please where is the problem? Thank you in advance.
Stored procedure is:
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