kreta/Kreta.DataAccess.Migrations/Scripts/Archive/20171018201918_KRETA_3764/DictionaryItemsCreate.sql
2024-03-13 00:33:46 +01:00

31 lines
1.2 KiB
Transact-SQL

DECLARE intezmenytanevekCursor CURSOR LOCAL FOR
SELECT C_INTEZMENYID, C_TANEVID
FROM T_INTEZMENYADATOK
DECLARE @intezmenyId int, @tanevId int
OPEN intezmenytanevekCursor
FETCH NEXT FROM intezmenytanevekCursor INTO @intezmenyId, @tanevId
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT N'INTÉZMÉNY ID: ' + CAST(@intezmenyId AS NVARCHAR(10)) + N', TANÉV ID: ' + CAST(@tanevId AS NVARCHAR(10))
SET IDENTITY_INSERT [dbo].[T_DICTIONARYITEMBASE] ON
INSERT INTO dbo.T_DICTIONARYITEMBASE (ID, C_NAME, C_NAME_1, C_NAME_2, C_NAME_3, C_NAME_4, C_TYPE, C_PROTECTED, C_VISIBLE, C_ORDER, C_CODE, C_VALUE, C_COLOR, C_INTEZMENYID, C_TANEVID, TOROLT, SERIAL, LASTCHANGED, CREATED, MODIFIER, CREATOR)
VALUES
(6835, N'tömb', N'tömb', NULL, NULL, NULL, N'KozteruletJelleg', N'F', N'T', 2, NULL, 97, NULL, @IntezmenyId, @TanevId, 'F', 0, GETDATE(), GETDATE(), NULL, NULL)
SET IDENTITY_INSERT [dbo].[T_DICTIONARYITEMBASE] OFF
INSERT INTO [dbo].[T_KOZTERULETJELLEG] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]) VALUES
(6835, @IntezmenyId, @TanevId)
FETCH NEXT FROM intezmenytanevekCursor INTO @intezmenyId, @tanevId
END
CLOSE intezmenytanevekCursor
DEALLOCATE intezmenytanevekCursor
GO