﻿GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;

SET NUMERIC_ROUNDABORT OFF;


GO
PRINT N'Creating [dbo].[T_ORAREND]...';


GO
CREATE TABLE [dbo].[T_ORAREND] (
    [ID]                      INT      IDENTITY (1, 1) NOT NULL,
    [C_ADMINALTALKIIRT]       CHAR (1) NOT NULL,
    [C_CSENGETESIRENDID]      INT      NULL,
    [C_CSENGETESIRENDORAID]   INT      NULL,
    [C_HETIREND]              INT      NOT NULL,
    [C_HETNAPJA]              INT      NOT NULL,
    [C_IMPORTALT]             CHAR (1) NOT NULL,
    [C_ORAERVENYESSEGKEZDETE] DATETIME NOT NULL,
    [C_ORAERVENYESSEGVEGE]    DATETIME NOT NULL,
    [C_ORAKEZDETE]            DATETIME NOT NULL,
    [C_ORARENDIORAGROUPID]    INT      NULL,
    [C_ORASZAM]               INT      NOT NULL,
    [C_ORAVEGE]               DATETIME NOT NULL,
    [C_SORSZAMOZANDO]         CHAR (1) NULL,
    [C_TANTARGYID]            INT      NULL,
    [C_TANARID]               INT      NULL,
    [C_TEREMID]               INT      NULL,
    [C_OSZTALYCSOPORTID]      INT      NULL,
    [C_INTEZMENYID]           INT      NOT NULL,
    [C_TANEVID]               INT      NOT NULL,
    [TOROLT]                  CHAR (1) NOT NULL,
    [SERIAL]                  INT      NOT NULL,
    [LASTCHANGED]             DATETIME NOT NULL,
    [CREATED]                 DATETIME NOT NULL,
    [MODIFIER]                INT      NULL,
    [CREATOR]                 INT      NULL,
    [ELOZOTANEVIREKORDID]     INT      NULL,
    [NNID]                    INT      NULL,
    CONSTRAINT [PK_T_4027956] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_4027956_4027960]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027956_4027960]
    ON [dbo].[T_ORAREND]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_HETIREND] ASC);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_4027956_4027961]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027956_4027961]
    ON [dbo].[T_ORAREND]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_HETNAPJA] ASC);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_4028008_4028006]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028008_4028006]
    ON [dbo].[T_ORAREND]([C_TANTARGYID] ASC);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_4028023_4028021]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028023_4028021]
    ON [dbo].[T_ORAREND]([C_TANARID] ASC);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_4028026_4028024]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028026_4028024]
    ON [dbo].[T_ORAREND]([C_TEREMID] ASC);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_4028029_4028027]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028029_4028027]
    ON [dbo].[T_ORAREND]([C_OSZTALYCSOPORTID] ASC);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_402795602_402795600]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402795602_402795600]
    ON [dbo].[T_ORAREND]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_ORAREND].[I_T_402795605_402795603]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402795605_402795603]
    ON [dbo].[T_ORAREND]([C_TANEVID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDORATULAJDONSAG]...';


GO
CREATE TABLE [dbo].[T_ORARENDORATULAJDONSAG] (
    [ID]                  INT      IDENTITY (1, 1) NOT NULL,
    [C_ORATULAJDONSAGID]  INT      NULL,
    [C_ORARENDID]         INT      NULL,
    [C_INTEZMENYID]       INT      NOT NULL,
    [C_TANEVID]           INT      NOT NULL,
    [TOROLT]              CHAR (1) NOT NULL,
    [SERIAL]              INT      NOT NULL,
    [LASTCHANGED]         DATETIME NOT NULL,
    [CREATED]             DATETIME NOT NULL,
    [MODIFIER]            INT      NULL,
    [CREATOR]             INT      NULL,
    [ELOZOTANEVIREKORDID] INT      NULL,
    [NNID]                INT      NULL,
    CONSTRAINT [PK_T_4027998] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_ORARENDORATULAJDONSAG].[I_T_4027998_4027999]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027998_4027999]
    ON [dbo].[T_ORARENDORATULAJDONSAG]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_ORATULAJDONSAGID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDORATULAJDONSAG].[I_T_4028020_4028018]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028020_4028018]
    ON [dbo].[T_ORARENDORATULAJDONSAG]([C_ORARENDID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDORATULAJDONSAG].[I_T_402799802_402799800]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402799802_402799800]
    ON [dbo].[T_ORARENDORATULAJDONSAG]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDORATULAJDONSAG].[I_T_402799805_402799803]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402799805_402799803]
    ON [dbo].[T_ORARENDORATULAJDONSAG]([C_TANEVID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDSABLON]...';


GO
CREATE TABLE [dbo].[T_ORARENDSABLON] (
    [ID]                    INT             IDENTITY (1, 1) NOT NULL,
    [C_HELYETTESITESOKA]    NVARCHAR (1000) NULL,
    [C_HELYETTESITESTIPUSA] INT             NULL,
    [C_HELYETTESITETT]      CHAR (1)        NOT NULL,
    [C_ORAKEZDETE]          DATETIME        NOT NULL,
    [C_ORAVEGE]             DATETIME        NOT NULL,
    [C_ORARENDID]           INT             NULL,
    [C_HELYETTESITOTANARID] INT             NULL,
    [C_INTEZMENYID]         INT             NOT NULL,
    [C_TANEVID]             INT             NOT NULL,
    [TOROLT]                CHAR (1)        NOT NULL,
    [SERIAL]                INT             NOT NULL,
    [LASTCHANGED]           DATETIME        NOT NULL,
    [CREATED]               DATETIME        NOT NULL,
    [MODIFIER]              INT             NULL,
    [CREATOR]               INT             NULL,
    [ELOZOTANEVIREKORDID]   INT             NULL,
    [NNID]                  INT             NULL,
    CONSTRAINT [PK_T_4027971] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_ORARENDSABLON].[I_T_4027971_4027973]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027971_4027973]
    ON [dbo].[T_ORARENDSABLON]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_HELYETTESITESTIPUSA] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDSABLON].[I_T_4028014_4028012]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028014_4028012]
    ON [dbo].[T_ORARENDSABLON]([C_ORARENDID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDSABLON].[I_T_4028038_4028036]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028038_4028036]
    ON [dbo].[T_ORARENDSABLON]([C_HELYETTESITOTANARID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDSABLON].[I_T_402797102_402797100]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402797102_402797100]
    ON [dbo].[T_ORARENDSABLON]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_ORARENDSABLON].[I_T_402797105_402797103]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402797105_402797103]
    ON [dbo].[T_ORARENDSABLON]([C_TANEVID] ASC);


GO
PRINT N'Creating [dbo].[T_ORATULAJDONSAGTIPUS]...';


GO
CREATE TABLE [dbo].[T_ORATULAJDONSAGTIPUS] (
    [ID]                   INT      NOT NULL,
    [C_ALINTEZMENYID]      INT      NOT NULL,
    [C_ALTANEVID]          INT      NOT NULL,
    [TOROLT]               CHAR (1) NOT NULL,
    [SERIAL]               INT      NOT NULL,
    [LASTCHANGED]          DATETIME NOT NULL,
    [CREATED]              DATETIME NOT NULL,
    [MODIFIER]             INT      NULL,
    [CREATOR]              INT      NULL,
    [ELOZOTANEVIREKORDID]  INT      NULL,
    [ELOZOTANEVIREKORDIDA] INT      NULL,
    [NNID]                 INT      NULL,
    CONSTRAINT [PK_T_4027970] PRIMARY KEY CLUSTERED ([ID] ASC, [C_ALINTEZMENYID] ASC, [C_ALTANEVID] ASC)
);


GO
PRINT N'Creating [dbo].[T_ORATULAJDONSAGTIPUS].[I_T_402797002_402797000]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402797002_402797000]
    ON [dbo].[T_ORATULAJDONSAGTIPUS]([C_ALINTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_ORATULAJDONSAGTIPUS].[I_T_402797005_402797003]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402797005_402797003]
    ON [dbo].[T_ORATULAJDONSAGTIPUS]([C_ALTANEVID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA]...';


GO
CREATE TABLE [dbo].[T_TANORA] (
    [ID]                    INT             IDENTITY (1, 1) NOT NULL,
    [C_ADMINALTALKIIRT]     CHAR (1)        NOT NULL,
    [C_CSENGETESIRENDID]    INT             NULL,
    [C_CSENGETESIRENDORAID] INT             NULL,
    [C_ELMARADTORA]         CHAR (1)        NOT NULL,
    [C_HAZIFELADAT]         NVARCHAR (MAX)  NULL,
    [C_HELYETTESITESOKA]    NVARCHAR (1000) NULL,
    [C_HELYETTESITESTIPUSA] INT             NULL,
    [C_HELYETTESITETT]      CHAR (1)        NOT NULL,
    [C_HETNAPJA]            INT             NULL,
    [C_MEGJEGYZES]          NVARCHAR (1000) NULL,
    [C_MOBILNAPLOZOTT]      CHAR (1)        NOT NULL,
    [C_NAPLOZASIDEJE]       DATETIME        NOT NULL,
    [C_NAPLOZOTT]           CHAR (1)        NOT NULL,
    [C_ORAKEZDETE]          DATETIME        NOT NULL,
    [C_ORAOSSZEVONASID]     INT             NULL,
    [C_ORARENDIORAGROUPID]  INT             NULL,
    [C_ORASZAM]             INT             NOT NULL,
    [C_ORAVEGE]             DATETIME        NOT NULL,
    [C_SORSZAMOZANDO]       CHAR (1)        NOT NULL,
    [C_TEMA]                NVARCHAR (1000) NULL,
    [C_TANMENETID]          INT             NULL,
    [C_TANTARGYID]          INT             NULL,
    [C_ORARENDID]           INT             NULL,
    [C_TANARID]             INT             NULL,
    [C_HELYETTESITOTANARID] INT             NULL,
    [C_TEREMID]             INT             NULL,
    [C_INTEZMENYID]         INT             NOT NULL,
    [C_TANEVID]             INT             NOT NULL,
    [TOROLT]                CHAR (1)        NOT NULL,
    [SERIAL]                INT             NOT NULL,
    [LASTCHANGED]           DATETIME        NOT NULL,
    [CREATED]               DATETIME        NOT NULL,
    [MODIFIER]              INT             NULL,
    [CREATOR]               INT             NULL,
    [ELOZOTANEVIREKORDID]   INT             NULL,
    [NNID]                  INT             NULL,
    CONSTRAINT [PK_T_4027977] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4027977_4027984]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027977_4027984]
    ON [dbo].[T_TANORA]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_HELYETTESITESTIPUSA] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4027977_4027986]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027977_4027986]
    ON [dbo].[T_TANORA]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_HETNAPJA] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4028002_4028000]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028002_4028000]
    ON [dbo].[T_TANORA]([C_TANMENETID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4028005_4028003]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028005_4028003]
    ON [dbo].[T_TANORA]([C_TANTARGYID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4028016_4028015]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028016_4028015]
    ON [dbo].[T_TANORA]([C_ORARENDID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4028032_4028030]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028032_4028030]
    ON [dbo].[T_TANORA]([C_TANARID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4028035_4028033]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028035_4028033]
    ON [dbo].[T_TANORA]([C_HELYETTESITOTANARID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_4028041_4028039]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028041_4028039]
    ON [dbo].[T_TANORA]([C_TEREMID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_402797702_402797700]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402797702_402797700]
    ON [dbo].[T_TANORA]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA].[I_T_402797705_402797703]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402797705_402797703]
    ON [dbo].[T_TANORA]([C_TANEVID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA_OSZTALYCSOPORT]...';


GO
CREATE TABLE [dbo].[T_TANORA_OSZTALYCSOPORT] (
    [C_TANORAID]          INT NOT NULL,
    [C_OSZTALYCSOPORTID]  INT NOT NULL,
    [ELOZOTANEVIREKORDID] INT NULL,
    [NNID]                INT NULL,
    CONSTRAINT [PK_T_T_TANORA_OSZTALYCSOPORT] PRIMARY KEY CLUSTERED ([C_TANORAID] ASC, [C_OSZTALYCSOPORTID] ASC)
);


GO
PRINT N'Creating [dbo].[T_TANORA_OSZTALYCSOPORT].[I_T_4028043_4027977]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028043_4027977]
    ON [dbo].[T_TANORA_OSZTALYCSOPORT]([C_TANORAID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORA_OSZTALYCSOPORT].[I_T_4028044_4025296]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028044_4025296]
    ON [dbo].[T_TANORA_OSZTALYCSOPORT]([C_OSZTALYCSOPORTID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORAORATULAJDONSAG]...';


GO
CREATE TABLE [dbo].[T_TANORAORATULAJDONSAG] (
    [ID]                  INT      IDENTITY (1, 1) NOT NULL,
    [C_ORATULAJDONSAGID]  INT      NULL,
    [C_TANORAID]          INT      NULL,
    [C_INTEZMENYID]       INT      NOT NULL,
    [C_TANEVID]           INT      NOT NULL,
    [TOROLT]              CHAR (1) NOT NULL,
    [SERIAL]              INT      NOT NULL,
    [LASTCHANGED]         DATETIME NOT NULL,
    [CREATED]             DATETIME NOT NULL,
    [MODIFIER]            INT      NULL,
    [CREATOR]             INT      NULL,
    [ELOZOTANEVIREKORDID] INT      NULL,
    [NNID]                INT      NULL,
    CONSTRAINT [PK_T_4027954] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_TANORAORATULAJDONSAG].[I_T_4027954_4027955]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027954_4027955]
    ON [dbo].[T_TANORAORATULAJDONSAG]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_ORATULAJDONSAGID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORAORATULAJDONSAG].[I_T_4028011_4028009]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028011_4028009]
    ON [dbo].[T_TANORAORATULAJDONSAG]([C_TANORAID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORAORATULAJDONSAG].[I_T_402795402_402795400]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402795402_402795400]
    ON [dbo].[T_TANORAORATULAJDONSAG]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_TANORAORATULAJDONSAG].[I_T_402795405_402795403]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402795405_402795403]
    ON [dbo].[T_TANORAORATULAJDONSAG]([C_TANEVID] ASC);


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORAREND]...';


GO
ALTER TABLE [dbo].[T_ORAREND]
    ADD DEFAULT ('F') FOR [TOROLT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORAREND]...';


GO
ALTER TABLE [dbo].[T_ORAREND]
    ADD DEFAULT ('F') FOR [C_ADMINALTALKIIRT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORAREND]...';


GO
ALTER TABLE [dbo].[T_ORAREND]
    ADD DEFAULT ('F') FOR [C_IMPORTALT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORAREND]...';


GO
ALTER TABLE [dbo].[T_ORAREND]
    ADD DEFAULT ('T') FOR [C_SORSZAMOZANDO];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORAREND]...';


GO
ALTER TABLE [dbo].[T_ORAREND]
    ADD DEFAULT (getdate()) FOR [LASTCHANGED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORAREND]...';


GO
ALTER TABLE [dbo].[T_ORAREND]
    ADD DEFAULT (getdate()) FOR [CREATED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORAREND]...';


GO
ALTER TABLE [dbo].[T_ORAREND]
    ADD DEFAULT ((0)) FOR [SERIAL];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG]
    ADD DEFAULT ('F') FOR [TOROLT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG]
    ADD DEFAULT (getdate()) FOR [CREATED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG]
    ADD DEFAULT ((0)) FOR [SERIAL];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG]
    ADD DEFAULT (getdate()) FOR [LASTCHANGED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDSABLON]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON]
    ADD DEFAULT ((0)) FOR [SERIAL];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDSABLON]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON]
    ADD DEFAULT ('F') FOR [TOROLT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDSABLON]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON]
    ADD DEFAULT ('F') FOR [C_HELYETTESITETT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDSABLON]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON]
    ADD DEFAULT (getdate()) FOR [CREATED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORARENDSABLON]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON]
    ADD DEFAULT (getdate()) FOR [LASTCHANGED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORATULAJDONSAGTIPUS]...';


GO
ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS]
    ADD DEFAULT (getdate()) FOR [CREATED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORATULAJDONSAGTIPUS]...';


GO
ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS]
    ADD DEFAULT ('F') FOR [TOROLT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORATULAJDONSAGTIPUS]...';


GO
ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS]
    ADD DEFAULT ((0)) FOR [SERIAL];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_ORATULAJDONSAGTIPUS]...';


GO
ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS]
    ADD DEFAULT (getdate()) FOR [LASTCHANGED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ('F') FOR [C_MOBILNAPLOZOTT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ('F') FOR [C_HELYETTESITETT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ('F') FOR [C_ELMARADTORA];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT (getdate()) FOR [LASTCHANGED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT (getdate()) FOR [CREATED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ('F') FOR [C_NAPLOZOTT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ('T') FOR [C_SORSZAMOZANDO];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ('F') FOR [C_ADMINALTALKIIRT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ('F') FOR [TOROLT];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORA]...';


GO
ALTER TABLE [dbo].[T_TANORA]
    ADD DEFAULT ((0)) FOR [SERIAL];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORAORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG]
    ADD DEFAULT (getdate()) FOR [LASTCHANGED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORAORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG]
    ADD DEFAULT ((0)) FOR [SERIAL];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORAORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG]
    ADD DEFAULT (getdate()) FOR [CREATED];


GO
PRINT N'Creating unnamed constraint on [dbo].[T_TANORAORATULAJDONSAG]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG]
    ADD DEFAULT ('F') FOR [TOROLT];


GO
PRINT N'Creating [dbo].[FK_4027956_4027960]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_4027956_4027960] FOREIGN KEY ([C_HETIREND], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_HETIRENDTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


GO
PRINT N'Creating [dbo].[FK_4027956_4027961]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_4027956_4027961] FOREIGN KEY ([C_HETNAPJA], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_HETNAPJATIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


GO
PRINT N'Creating [dbo].[FK_4028008_4028006]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_4028008_4028006] FOREIGN KEY ([C_TANTARGYID]) REFERENCES [dbo].[T_TANTARGY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028023_4028021]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_4028023_4028021] FOREIGN KEY ([C_TANARID]) REFERENCES [dbo].[T_ALKALMAZOTT] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028026_4028024]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_4028026_4028024] FOREIGN KEY ([C_TEREMID]) REFERENCES [dbo].[T_TEREM] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028029_4028027]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_4028029_4028027] FOREIGN KEY ([C_OSZTALYCSOPORTID]) REFERENCES [dbo].[T_OSZTALYCSOPORT] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402795602_402795600]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_402795602_402795600] FOREIGN KEY ([C_INTEZMENYID]) REFERENCES [dbo].[T_INTEZMENY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402795605_402795603]...';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH NOCHECK
    ADD CONSTRAINT [FK_402795605_402795603] FOREIGN KEY ([C_TANEVID]) REFERENCES [dbo].[T_TANEV] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028020_4028018]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_4028020_4028018] FOREIGN KEY ([C_ORARENDID]) REFERENCES [dbo].[T_ORAREND] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402799802_402799800]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_402799802_402799800] FOREIGN KEY ([C_INTEZMENYID]) REFERENCES [dbo].[T_INTEZMENY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402799805_402799803]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_402799805_402799803] FOREIGN KEY ([C_TANEVID]) REFERENCES [dbo].[T_TANEV] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4027998_4027999]...';


GO
ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_4027998_4027999] FOREIGN KEY ([C_ORATULAJDONSAGID], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ORATULAJDONSAGTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


GO
PRINT N'Creating [dbo].[FK_4028014_4028012]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON] WITH NOCHECK
    ADD CONSTRAINT [FK_4028014_4028012] FOREIGN KEY ([C_ORARENDID]) REFERENCES [dbo].[T_ORAREND] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028038_4028036]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON] WITH NOCHECK
    ADD CONSTRAINT [FK_4028038_4028036] FOREIGN KEY ([C_HELYETTESITOTANARID]) REFERENCES [dbo].[T_ALKALMAZOTT] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402797102_402797100]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON] WITH NOCHECK
    ADD CONSTRAINT [FK_402797102_402797100] FOREIGN KEY ([C_INTEZMENYID]) REFERENCES [dbo].[T_INTEZMENY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402797105_402797103]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON] WITH NOCHECK
    ADD CONSTRAINT [FK_402797105_402797103] FOREIGN KEY ([C_TANEVID]) REFERENCES [dbo].[T_TANEV] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4027971_4027973]...';


GO
ALTER TABLE [dbo].[T_ORARENDSABLON] WITH NOCHECK
    ADD CONSTRAINT [FK_4027971_4027973] FOREIGN KEY ([C_HELYETTESITESTIPUSA], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_HELYETTESITESTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


GO
PRINT N'Creating [dbo].[FK_T_21038_4028045]...';


GO
ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS] WITH NOCHECK
    ADD CONSTRAINT [FK_T_21038_4028045] FOREIGN KEY ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]) REFERENCES [dbo].[T_DICTIONARYITEMBASE] ([ID], [C_INTEZMENYID], [C_TANEVID]);


GO
PRINT N'Creating [dbo].[FK_402797002_402797000]...';


GO
ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS] WITH NOCHECK
    ADD CONSTRAINT [FK_402797002_402797000] FOREIGN KEY ([C_ALINTEZMENYID]) REFERENCES [dbo].[T_INTEZMENY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402797005_402797003]...';


GO
ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS] WITH NOCHECK
    ADD CONSTRAINT [FK_402797005_402797003] FOREIGN KEY ([C_ALTANEVID]) REFERENCES [dbo].[T_TANEV] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028002_4028000]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028002_4028000] FOREIGN KEY ([C_TANMENETID]) REFERENCES [dbo].[T_TANMENET] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028005_4028003]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028005_4028003] FOREIGN KEY ([C_TANTARGYID]) REFERENCES [dbo].[T_TANTARGY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028016_4028015]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028016_4028015] FOREIGN KEY ([C_ORARENDID]) REFERENCES [dbo].[T_ORAREND] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028032_4028030]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028032_4028030] FOREIGN KEY ([C_TANARID]) REFERENCES [dbo].[T_ALKALMAZOTT] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028035_4028033]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028035_4028033] FOREIGN KEY ([C_HELYETTESITOTANARID]) REFERENCES [dbo].[T_ALKALMAZOTT] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028041_4028039]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028041_4028039] FOREIGN KEY ([C_TEREMID]) REFERENCES [dbo].[T_TEREM] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402797702_402797700]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_402797702_402797700] FOREIGN KEY ([C_INTEZMENYID]) REFERENCES [dbo].[T_INTEZMENY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402797705_402797703]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_402797705_402797703] FOREIGN KEY ([C_TANEVID]) REFERENCES [dbo].[T_TANEV] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4027977_4027984]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4027977_4027984] FOREIGN KEY ([C_HELYETTESITESTIPUSA], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_HELYETTESITESTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


GO
PRINT N'Creating [dbo].[FK_4027977_4027986]...';


GO
ALTER TABLE [dbo].[T_TANORA] WITH NOCHECK
    ADD CONSTRAINT [FK_4027977_4027986] FOREIGN KEY ([C_HETNAPJA], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_HETNAPJATIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


GO
PRINT N'Creating [dbo].[FK_4028043_4028042]...';


GO
ALTER TABLE [dbo].[T_TANORA_OSZTALYCSOPORT] WITH NOCHECK
    ADD CONSTRAINT [FK_4028043_4028042] FOREIGN KEY ([C_TANORAID]) REFERENCES [dbo].[T_TANORA] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4028044_4028042]...';


GO
ALTER TABLE [dbo].[T_TANORA_OSZTALYCSOPORT] WITH NOCHECK
    ADD CONSTRAINT [FK_4028044_4028042] FOREIGN KEY ([C_OSZTALYCSOPORTID]) REFERENCES [dbo].[T_OSZTALYCSOPORT] ([ID]);


GO
PRINT N'Creating [dbo].[FK_4027954_4027955]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_4027954_4027955] FOREIGN KEY ([C_ORATULAJDONSAGID], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ORATULAJDONSAGTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


GO
PRINT N'Creating [dbo].[FK_4028011_4028009]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_4028011_4028009] FOREIGN KEY ([C_TANORAID]) REFERENCES [dbo].[T_TANORA] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402795402_402795400]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_402795402_402795400] FOREIGN KEY ([C_INTEZMENYID]) REFERENCES [dbo].[T_INTEZMENY] ([ID]);


GO
PRINT N'Creating [dbo].[FK_402795405_402795403]...';


GO
ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH NOCHECK
    ADD CONSTRAINT [FK_402795405_402795403] FOREIGN KEY ([C_TANEVID]) REFERENCES [dbo].[T_TANEV] ([ID]);


GO
PRINT N'Checking existing data against newly created constraints';


GO
ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_4027956_4027960];

ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_4027956_4027961];

ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_4028008_4028006];

ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_4028023_4028021];

ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_4028026_4028024];

ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_4028029_4028027];

ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_402795602_402795600];

ALTER TABLE [dbo].[T_ORAREND] WITH CHECK CHECK CONSTRAINT [FK_402795605_402795603];

ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_4028020_4028018];

ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_402799802_402799800];

ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_402799805_402799803];

ALTER TABLE [dbo].[T_ORARENDORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_4027998_4027999];

ALTER TABLE [dbo].[T_ORARENDSABLON] WITH CHECK CHECK CONSTRAINT [FK_4028014_4028012];

ALTER TABLE [dbo].[T_ORARENDSABLON] WITH CHECK CHECK CONSTRAINT [FK_4028038_4028036];

ALTER TABLE [dbo].[T_ORARENDSABLON] WITH CHECK CHECK CONSTRAINT [FK_402797102_402797100];

ALTER TABLE [dbo].[T_ORARENDSABLON] WITH CHECK CHECK CONSTRAINT [FK_402797105_402797103];

ALTER TABLE [dbo].[T_ORARENDSABLON] WITH CHECK CHECK CONSTRAINT [FK_4027971_4027973];

ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS] WITH CHECK CHECK CONSTRAINT [FK_T_21038_4028045];

ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402797002_402797000];

ALTER TABLE [dbo].[T_ORATULAJDONSAGTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402797005_402797003];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4028002_4028000];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4028005_4028003];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4028016_4028015];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4028032_4028030];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4028035_4028033];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4028041_4028039];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_402797702_402797700];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_402797705_402797703];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4027977_4027984];

ALTER TABLE [dbo].[T_TANORA] WITH CHECK CHECK CONSTRAINT [FK_4027977_4027986];

ALTER TABLE [dbo].[T_TANORA_OSZTALYCSOPORT] WITH CHECK CHECK CONSTRAINT [FK_4028043_4028042];

ALTER TABLE [dbo].[T_TANORA_OSZTALYCSOPORT] WITH CHECK CHECK CONSTRAINT [FK_4028044_4028042];

ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_4027954_4027955];

ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_4028011_4028009];

ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_402795402_402795400];

ALTER TABLE [dbo].[T_TANORAORATULAJDONSAG] WITH CHECK CHECK CONSTRAINT [FK_402795405_402795403];


GO
PRINT N'Update complete.';


GO
