I try wirte query for update kills for player, but i have some errors
Code:
USE PS_GameData
DECLARE @CharID INT = (Select CharID FROM PS_GameData.dbo.Chars),
@Oldk1 INT = (SELECT K1 FROM PS_GameData.dbo.Chars WHERE Slot = '0'),
@Newk1 INT = (SELECT K1 FROM PS_GameData.dbo.Chars WHERE Slot = '1')
BEGIN
UPDATE PS_GameData.dbo.chars
Set K1 = @Oldk1 + @Newk1
WHERE UserUID ='1' and slot = '1'
END
Anyone can help me? ;C
Error:
Code:
Msg 512, Level 16, State 1, Line 2 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Msg 515, Level 16, State 2, Line 6 Cannot insert the value NULL into column 'K1', table 'PS_GameData.dbo.Chars'; column does not allow nulls. UPDATE fails. The statement has been terminated.






