DROP PROCEDURE IF EXISTS uspSetHazifeladatAsKikuldott
GO

CREATE PROCEDURE uspSetHazifeladatAsKikuldott
  @pHazifeladatIdListString nvarchar(max)
AS
BEGIN
  SET NOCOUNT ON;
  
  DECLARE @hazifeladatList TABLE(Id int NOT NULL PRIMARY KEY CLUSTERED)
  ​
  INSERT INTO @hazifeladatList(Id)
  SELECT VALUE FROM STRING_SPLIT(@pHazifeladatIdListString, ',')
​
  UPDATE hf SET 
     C_ISERTESITESKIKULDVE = 'T'
    ,SERIAL = SERIAL + 1
    ,LASTCHANGED = GETDATE()
    ,MODIFIER = 0
  FROM T_DKT_FELADAT hf 
    INNER JOIN @hazifeladatList item ON hf.ID = item.Id

END 

GO

