﻿SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF OBJECT_ID('dev.uspCreateTanevRendje20182019') IS NOT NULL BEGIN
  DROP PROCEDURE [dev].[uspCreateTanevRendje20182019]
END  
GO

CREATE PROCEDURE [dev].[uspCreateTanevRendje20182019]
	@intezmenyId int,
	@tanevId int
AS
BEGIN
	
	SET NOCOUNT ON;
	SET DATEFIRST 1;

	INSERT [dbo].[T_TANEVRENDJE] 
		([C_AKTIV], [C_DATUM], [C_HETIREND], [C_HETNAPJA], [C_MEGJEGYZES], [C_NAPTIPUSA], [C_ORARENDINAP], [C_OSSZESCSOPORTRAVONATKOZIK], [C_CSENGETESIRENDID], [C_INTEZMENYID], [C_TANEVID], [TOROLT], [SERIAL], [LASTCHANGED], [CREATED], [MODIFIER], [CREATOR]) 
	VALUES
		('T', '20180903', 1554, dbo.fnGetHetNapja('20180903'), N'', 1394, 'F', 'T', NULL, @intezmenyId, @tanevId, 'F', 0, GETDATE(), GETDATE(), NULL, 1),
		('T', '20190614', 1554, dbo.fnGetHetNapja('20190614'), N'', 1395, 'F', 'T', NULL, @intezmenyId, @tanevId, 'F', 0, GETDATE(), GETDATE(), NULL, 1)
END