﻿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_KOZMUSZAMLA]...';


GO
CREATE TABLE [dbo].[T_KOZMUSZAMLA] (
    [ID]                   INT             IDENTITY (1, 1) NOT NULL,
    [C_BEFIZETESDATUMA]    DATETIME        NULL,
    [C_FIZETESIHATARIDO]   DATETIME        NULL,
    [C_FIZETVE]            CHAR (1)        NOT NULL,
    [C_INVALIDITASOKA]     NVARCHAR (MAX)  NULL,
    [C_KELTE]              DATETIME        NULL,
    [C_KIBOCSATO]          NVARCHAR (MAX)  NULL,
    [C_KOZMUSZAMLATIPUSID] INT             NULL,
    [C_OSSZEG]             NUMERIC (10, 2) NULL,
    [C_PENZNEMID]          INT             NULL,
    [C_VALID]              CHAR (1)        NOT NULL,
    [C_VALIDALASALATT]     CHAR (1)        NOT 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_4028171] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_KOZMUSZAMLA].[I_T_4028171_4028178]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028171_4028178]
    ON [dbo].[T_KOZMUSZAMLA]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_KOZMUSZAMLATIPUSID] ASC);


GO
PRINT N'Creating [dbo].[T_KOZMUSZAMLA].[I_T_4028171_4028180]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028171_4028180]
    ON [dbo].[T_KOZMUSZAMLA]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_PENZNEMID] ASC);


GO
PRINT N'Creating [dbo].[T_KOZMUSZAMLA].[I_T_402817102_402817100]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402817102_402817100]
    ON [dbo].[T_KOZMUSZAMLA]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_KOZMUSZAMLA].[I_T_402817105_402817103]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402817105_402817103]
    ON [dbo].[T_KOZMUSZAMLA]([C_TANEVID] ASC);


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


GO
CREATE TABLE [dbo].[T_KOZMUSZAMLATIPUS] (
    [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_4028166] PRIMARY KEY CLUSTERED ([ID] ASC, [C_ALINTEZMENYID] ASC, [C_ALTANEVID] ASC)
);


GO
PRINT N'Creating [dbo].[T_KOZMUSZAMLATIPUS].[I_T_402816602_402816600]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402816602_402816600]
    ON [dbo].[T_KOZMUSZAMLATIPUS]([C_ALINTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_KOZMUSZAMLATIPUS].[I_T_402816605_402816603]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402816605_402816603]
    ON [dbo].[T_KOZMUSZAMLATIPUS]([C_ALTANEVID] ASC);


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


GO
CREATE TABLE [dbo].[T_MEROALLAS] (
    [ID]                  INT             IDENTITY (1, 1) NOT NULL,
    [C_ERTEK]             NUMERIC (10, 2) NULL,
    [C_LEOLVASASDATUMA]   DATETIME        NULL,
    [C_MEROHELYID]        INT             NOT 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_4028184] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_MEROALLAS].[I_T_4028193_4028191]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028193_4028191]
    ON [dbo].[T_MEROALLAS]([C_MEROHELYID] ASC);


GO
PRINT N'Creating [dbo].[T_MEROALLAS].[I_T_402818402_402818400]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402818402_402818400]
    ON [dbo].[T_MEROALLAS]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_MEROALLAS].[I_T_402818405_402818403]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402818405_402818403]
    ON [dbo].[T_MEROALLAS]([C_TANEVID] ASC);


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


GO
CREATE TABLE [dbo].[T_MEROHELY] (
    [ID]                             INT            IDENTITY (1, 1) NOT NULL,
    [C_MEROALLASFRISSITESESZUKSEGES] CHAR (1)       NOT NULL,
    [C_MEROHELYTIPUSID]              INT            NOT NULL,
    [C_NEV]                          NVARCHAR (MAX) NULL,
    [C_KOZMUSZAMLAID]                INT            NOT NULL,
    [C_MUKODESIHELYID]               INT            NOT 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_4028167] PRIMARY KEY CLUSTERED ([ID] ASC)
);


GO
PRINT N'Creating [dbo].[T_MEROHELY].[I_T_4028167_4028169]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028167_4028169]
    ON [dbo].[T_MEROHELY]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_MEROHELYTIPUSID] ASC);


GO
PRINT N'Creating [dbo].[T_MEROHELY].[I_T_4028189_4028188]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028189_4028188]
    ON [dbo].[T_MEROHELY]([C_KOZMUSZAMLAID] ASC);


GO
PRINT N'Creating [dbo].[T_MEROHELY].[I_T_4028195_4028194]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4028195_4028194]
    ON [dbo].[T_MEROHELY]([C_MUKODESIHELYID] ASC);


GO
PRINT N'Creating [dbo].[T_MEROHELY].[I_T_402816702_402816700]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402816702_402816700]
    ON [dbo].[T_MEROHELY]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_MEROHELY].[I_T_402816705_402816703]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402816705_402816703]
    ON [dbo].[T_MEROHELY]([C_TANEVID] ASC);


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


GO
CREATE TABLE [dbo].[T_MEROHELYTIPUS] (
    [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_4028183] PRIMARY KEY CLUSTERED ([ID] ASC, [C_ALINTEZMENYID] ASC, [C_ALTANEVID] ASC)
);


GO
PRINT N'Creating [dbo].[T_MEROHELYTIPUS].[I_T_402818302_402818300]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402818302_402818300]
    ON [dbo].[T_MEROHELYTIPUS]([C_ALINTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_MEROHELYTIPUS].[I_T_402818305_402818303]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402818305_402818303]
    ON [dbo].[T_MEROHELYTIPUS]([C_ALTANEVID] ASC);


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


GO
CREATE TABLE [dbo].[T_PENZNEMTIPUS] (
    [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_4028187] PRIMARY KEY CLUSTERED ([ID] ASC, [C_ALINTEZMENYID] ASC, [C_ALTANEVID] ASC)
);


GO
PRINT N'Creating [dbo].[T_PENZNEMTIPUS].[I_T_402818702_402818700]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402818702_402818700]
    ON [dbo].[T_PENZNEMTIPUS]([C_ALINTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_PENZNEMTIPUS].[I_T_402818705_402818703]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402818705_402818703]
    ON [dbo].[T_PENZNEMTIPUS]([C_ALTANEVID] ASC);


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


GO
ALTER TABLE [dbo].[T_KOZMUSZAMLA]
    ADD DEFAULT ('F') FOR [C_VALIDALASALATT];


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


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


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


GO
ALTER TABLE [dbo].[T_KOZMUSZAMLA]
    ADD DEFAULT ('F') FOR [C_FIZETVE];


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


GO
ALTER TABLE [dbo].[T_KOZMUSZAMLA]
    ADD DEFAULT ('F') FOR [C_VALID];


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_MEROHELY]
    ADD DEFAULT ('F') FOR [C_MEROALLASFRISSITESESZUKSEGES];


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_KOZMUSZAMLA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028171_4028178] FOREIGN KEY ([C_KOZMUSZAMLATIPUSID], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_KOZMUSZAMLATIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_KOZMUSZAMLA] WITH NOCHECK
    ADD CONSTRAINT [FK_4028171_4028180] FOREIGN KEY ([C_PENZNEMID], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_PENZNEMTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


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


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_MEROALLAS] WITH NOCHECK
    ADD CONSTRAINT [FK_4028193_4028191] FOREIGN KEY ([C_MEROHELYID]) REFERENCES [dbo].[T_MEROHELY] ([ID]);


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_MEROHELY] WITH NOCHECK
    ADD CONSTRAINT [FK_4028189_4028188] FOREIGN KEY ([C_KOZMUSZAMLAID]) REFERENCES [dbo].[T_KOZMUSZAMLA] ([ID]);


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


GO
ALTER TABLE [dbo].[T_MEROHELY] WITH NOCHECK
    ADD CONSTRAINT [FK_4028195_4028194] FOREIGN KEY ([C_MUKODESIHELYID]) REFERENCES [dbo].[T_MUKODESIHELY] ([ID]);


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_MEROHELY] WITH NOCHECK
    ADD CONSTRAINT [FK_4028167_4028169] FOREIGN KEY ([C_MEROHELYTIPUSID], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_MEROHELYTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


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


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


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


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


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


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


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


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_KOZMUSZAMLA] WITH CHECK CHECK CONSTRAINT [FK_402817102_402817100];

ALTER TABLE [dbo].[T_KOZMUSZAMLA] WITH CHECK CHECK CONSTRAINT [FK_402817105_402817103];

ALTER TABLE [dbo].[T_KOZMUSZAMLA] WITH CHECK CHECK CONSTRAINT [FK_4028171_4028178];

ALTER TABLE [dbo].[T_KOZMUSZAMLA] WITH CHECK CHECK CONSTRAINT [FK_4028171_4028180];

ALTER TABLE [dbo].[T_KOZMUSZAMLATIPUS] WITH CHECK CHECK CONSTRAINT [FK_T_21038_4028198];

ALTER TABLE [dbo].[T_KOZMUSZAMLATIPUS] WITH CHECK CHECK CONSTRAINT [FK_402816602_402816600];

ALTER TABLE [dbo].[T_KOZMUSZAMLATIPUS] WITH CHECK CHECK CONSTRAINT [FK_402816605_402816603];

ALTER TABLE [dbo].[T_MEROALLAS] WITH CHECK CHECK CONSTRAINT [FK_4028193_4028191];

ALTER TABLE [dbo].[T_MEROALLAS] WITH CHECK CHECK CONSTRAINT [FK_402818402_402818400];

ALTER TABLE [dbo].[T_MEROALLAS] WITH CHECK CHECK CONSTRAINT [FK_402818405_402818403];

ALTER TABLE [dbo].[T_MEROHELY] WITH CHECK CHECK CONSTRAINT [FK_4028189_4028188];

ALTER TABLE [dbo].[T_MEROHELY] WITH CHECK CHECK CONSTRAINT [FK_4028195_4028194];

ALTER TABLE [dbo].[T_MEROHELY] WITH CHECK CHECK CONSTRAINT [FK_402816702_402816700];

ALTER TABLE [dbo].[T_MEROHELY] WITH CHECK CHECK CONSTRAINT [FK_402816705_402816703];

ALTER TABLE [dbo].[T_MEROHELY] WITH CHECK CHECK CONSTRAINT [FK_4028167_4028169];

ALTER TABLE [dbo].[T_MEROHELYTIPUS] WITH CHECK CHECK CONSTRAINT [FK_T_21038_4028197];

ALTER TABLE [dbo].[T_MEROHELYTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402818302_402818300];

ALTER TABLE [dbo].[T_MEROHELYTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402818305_402818303];

ALTER TABLE [dbo].[T_PENZNEMTIPUS] WITH CHECK CHECK CONSTRAINT [FK_T_21038_4028199];

ALTER TABLE [dbo].[T_PENZNEMTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402818702_402818700];

ALTER TABLE [dbo].[T_PENZNEMTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402818705_402818703];


GO
PRINT N'Update complete.';


GO
