﻿SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

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

CREATE PROCEDURE [dbo].[sp_Global_CreateTanevRendje20172018]
	@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
		(N'T', CAST(N'2017-09-01 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-09-01 00:00:00.000' AS DateTime)), N'', 1394, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-10-23 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-10-23 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-10-30 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-10-30 00:00:00.000' AS DateTime)), N'', 1399, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-10-31 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-10-31 00:00:00.000' AS DateTime)), N'', 1399, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-11-01 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-11-01 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-11-02 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-11-02 00:00:00.000' AS DateTime)), N'', 1399, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-11-03 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-11-03 00:00:00.000' AS DateTime)), N'', 1399, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-12-25 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-12-25 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-12-26 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-12-26 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-12-27 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-12-27 00:00:00.000' AS DateTime)), N'', 1397, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-12-28 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-12-28 00:00:00.000' AS DateTime)), N'', 1397, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2017-12-29 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2017-12-29 00:00:00.000' AS DateTime)), N'', 1397, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-01-01 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-01-01 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-01-02 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-01-02 00:00:00.000' AS DateTime)), N'', 1397, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-01-19 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-01-19 00:00:00.000' AS DateTime)), N'', 1400, N'T', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-03-10 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-03-10 00:00:00.000' AS DateTime)), N'', 1385, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-03-15 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-03-15 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-03-16 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-03-16 00:00:00.000' AS DateTime)), N'', 6833, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-03-29 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-03-29 00:00:00.000' AS DateTime)), N'', 1398, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-03-30 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-03-30 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-04-02 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-04-02 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-04-03 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-04-03 00:00:00.000' AS DateTime)), N'', 1398, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-04-21 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-04-21 00:00:00.000' AS DateTime)), N'', 1385, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-04-30 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-04-30 00:00:00.000' AS DateTime)), N'', 6833, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-05-01 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-05-01 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-05-03 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-05-03 00:00:00.000' AS DateTime)), N'', 1402, N'T', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-05-21 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-05-21 00:00:00.000' AS DateTime)), N'', 1386, N'F', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1),
		(N'T', CAST(N'2018-06-15 00:00:00.000' AS DateTime), 1554, dbo.fnGetHetNapja(CAST(N'2018-06-15 00:00:00.000' AS DateTime)), N'', 1395, N'T', N'T', NULL, @intezmenyId, @tanevId, N'F', 0, GETDATE(), GETDATE(), NULL, 1)

END