อันนี้คือ store ที่เอาไว้อัพเดตเมื่อมีการบันทึกจำนวนที่นับได้
Code (SQL)
IF @Round_Count = 1
BEGIN
UPDATE Stock
SET Count1 = @Count_Value,
Count2 = 0,
Count3 = 0
WHERE ID_Item = @ID_Item AND ID_Brach = @ID_Brach AND Date_Count_Stock = @Date_Count_Stock;
END
ELSE IF @Round_Count = 2
BEGIN
UPDATE Stock
SET
Count1 = Count1,
Count2 = @Count_Value
WHERE ID_Item = @ID_Item AND ID_Brach = @ID_Brach AND Date_Count_Stock = @Date_Count_Stock;
END