﻿DROP PROCEDURE IF EXISTS dbo.uspSetTanuloErtekelesAsKikuldott
GO

CREATE PROCEDURE dbo.uspSetTanuloErtekelesAsKikuldott
  @item_list NVARCHAR(MAX) 
AS
SET NOCOUNT ON
DECLARE @items TABLE(id INT NOT NULL PRIMARY KEY CLUSTERED);

INSERT INTO @items(id)
SELECT VALUE FROM STRING_SPLIT(@item_list, ',');

UPDATE T_TANULOERTEKELES SET 
   C_ISERTESITESELKULDVE = 'T'
  ,LASTCHANGED = GETDATE()
  ,SERIAL = SERIAL + 1
  ,MODIFIER = 0
FROM T_TANULOERTEKELES f 
  INNER JOIN @items i on f.ID = i.id

GO
