DROP PROCEDURE IF EXISTS [sp_SetAktivCsengetesiRend] GO CREATE PROCEDURE [sp_SetAktivCsengetesiRend] @CsengrendID int, @Aktival bit, @TanevId int AS BEGIN SET NOCOUNT ON; IF (@Aktival = 1) BEGIN update [T_CSENGETESIREND_OSSZES] set [C_AKTIV] = 'F' WHERE C_TANEVID = @TanevId; update [T_CSENGETESIREND_OSSZES] set [C_AKTIV] = 'T' where [ID] = @CsengrendID AND C_TANEVID = @TanevId; END ELSE BEGIN update [T_CSENGETESIREND_OSSZES] set [C_AKTIV] = 'F' where [ID] = @CsengrendID AND C_TANEVID = @TanevId; END END GO