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

SET NUMERIC_ROUNDABORT OFF;


GO
PRINT N'Dropping [dbo].[FK_4027460_4027459]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027460_4027459];


GO
PRINT N'Dropping [dbo].[FK_402736302_402736300]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_402736302_402736300];


GO
PRINT N'Dropping [dbo].[FK_402736305_402736303]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_402736305_402736303];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027364]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027364];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027365]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027365];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027366]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027366];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027373]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027373];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027376]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027376];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027384]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027384];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027388]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027388];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027394]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027394];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027407]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027407];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027414]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027414];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027483]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027483];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027499]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027499];


GO
PRINT N'Dropping [dbo].[FK_4027363_4027502]...';


GO
ALTER TABLE [dbo].[T_NEBULO] DROP CONSTRAINT [FK_4027363_4027502];


GO
PRINT N'Starting rebuilding table [dbo].[T_NEBULO]...';


GO
BEGIN TRANSACTION;

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;

SET XACT_ABORT ON;

CREATE TABLE [dbo].[tmp_ms_xx_T_NEBULO] (
    [ID]                             INT             IDENTITY (1, 1) NOT NULL,
    [C_ALLAMPOLGARSAGA]              INT             NULL,
    [C_ALLAMPOLGARSAGA2]             INT             NULL,
    [C_ANYANYELVE]                   INT             NULL,
    [C_AZISKOLAALAKOHELYETOLEGYKILO] CHAR (1)        DEFAULT ('F') NULL,
    [C_EDESANYJASZULETESICSALADINEV] NVARCHAR (255)  NOT NULL,
    [C_EDESANYJASZULETESIUTONEVE]    NVARCHAR (255)  NOT NULL,
    [C_ELETVITELSZERUOTTLAKASKORZET] CHAR (1)        DEFAULT ('T') NULL,
    [C_ELOTAG]                       NVARCHAR (20)   NULL,
    [C_ETIKAHITERKOLCSTAN]           INT             NULL,
    [C_FELVETELSTATUSZA]             INT             NULL,
    [C_KEPVISELOCIMEAZONOS]          CHAR (1)        DEFAULT ('T') NOT NULL,
    [C_MEGJEGYZES]                   NVARCHAR (MAX)  NULL,
    [C_NEME]                         INT             NULL,
    [C_OKTATASIAZONOSITOSZAMA]       NVARCHAR (20)   NULL,
    [C_OVODAAZONOSITO]               NVARCHAR (20)   NULL,
    [C_OVODANEVE]                    NVARCHAR (255)  NULL,
    [C_SZAKERTOIBIZOTTSAGKORMANYHIV] CHAR (1)        DEFAULT ('F') NULL,
    [C_SZULETESICSALADINEVE]         NVARCHAR (255)  NULL,
    [C_SZULETESIHELY]                NVARCHAR (50)   NOT NULL,
    [C_SZULETESIIDO]                 DATETIME        NOT NULL,
    [C_SZULETESIORSZAG]              INT             NOT NULL,
    [C_SZULETESIUTONEVE]             NVARCHAR (255)  NULL,
    [C_SZULOJENEKMUNKAHELYEAZISKOLA] CHAR (1)        DEFAULT ('F') NULL,
    [C_SZULOJETESTVERETARTOSANBETEG] CHAR (1)        DEFAULT ('F') NULL,
    [C_TAGOZAT]                      INT             NULL,
    [C_TANULOCSALADINEVE]            NVARCHAR (255)  NOT NULL,
    [C_TANULOUTONEVE]                NVARCHAR (255)  NOT NULL,
    [C_TESTVEREAZINTEZMENYTANULOJA]  CHAR (1)        DEFAULT ('F') NULL,
    [C_TKEMAILCIM]                   NVARCHAR (255)  NULL,
    [C_TKNEVE]                       NVARCHAR (200)  NULL,
    [C_TKROKONSAGIFOKA]              INT             NULL,
    [C_TKTELEFON]                    NVARCHAR (20)   NULL,
    [C_AJTO]                         NVARCHAR (30)   NULL,
    [C_EMELET]                       NVARCHAR (40)   NULL,
    [C_HAZSZAM]                      NVARCHAR (30)   NULL,
    [C_HELYSEGNEV]                   NVARCHAR (255)  NULL,
    [C_IRANYITOSZAM]                 NVARCHAR (20)   NULL,
    [C_KOZTERULETJELLEGE]            INT             NULL,
    [C_KOZTERULETNEV]                NVARCHAR (40)   NULL,
    [C_TKAJTO]                       NVARCHAR (30)   NULL,
    [C_TKEMELET]                     NVARCHAR (40)   NULL,
    [C_TKHAZSZAM]                    NVARCHAR (30)   NULL,
    [C_TKHELYSEGNEV]                 NVARCHAR (255)  NULL,
    [C_TKIRANYITOSZAM]               NVARCHAR (20)   NULL,
    [C_TKKOZTERULETJELLEGE]          INT             NULL,
    [C_TKKOZTERULETNEV]              NVARCHAR (40)   NULL,
    [C_BTM]                          CHAR (1)        DEFAULT ('F') NULL,
    [C_BTMLETSZAMSULY]               NUMERIC (10, 2) DEFAULT ((1)) NULL,
    [C_SNI]                          CHAR (1)        DEFAULT ('F') NULL,
    [C_SNILETSZAMSULY]               NUMERIC (10, 2) DEFAULT ((1)) NULL,
    [C_THAJTO]                       NVARCHAR (30)   NULL,
    [C_THHAZSZAM]                    NVARCHAR (30)   NULL,
    [C_THHELYSEGNEV]                 NVARCHAR (255)  NULL,
    [C_THIRANYITOSZAM]               NVARCHAR (20)   NULL,
    [C_THKOZTERULETJELLEGE]          INT             NULL,
    [C_THKOZTERULETNEV]              NVARCHAR (40)   NULL,
    [C_THEMELET]                     NVARCHAR (40)   NULL,
    [C_TARTOZKODASIHELYAZONOS]       CHAR (1)        DEFAULT ('T') NOT NULL,
    [C_KEPVISELO2CIMEAZONOS]         CHAR (1)        DEFAULT ('T') NOT NULL,
    [C_TKAJTO2]                      NVARCHAR (30)   NULL,
    [C_TKEMAILCIM2]                  NVARCHAR (255)  NULL,
    [C_TKEMELET2]                    NVARCHAR (40)   NULL,
    [C_TKHAZSZAM2]                   NVARCHAR (30)   NULL,
    [C_TKHELYSEGNEV2]                NVARCHAR (255)  NULL,
    [C_TKIRANYITOSZAM2]              NVARCHAR (20)   NULL,
    [C_TKKOZTERULETJELLEGE2]         INT             NULL,
    [C_TKKOZTERULETNEV2]             NVARCHAR (40)   NULL,
    [C_TKNEVE2]                      NVARCHAR (200)  NULL,
    [C_TKROKONSAGIFOKA2]             INT             NULL,
    [C_TKTELEFON2]                   NVARCHAR (20)   NULL,
    [C_ERTESITESDATUMA]              DATETIME        NULL,
    [C_IMPORTALT]                    CHAR (1)        DEFAULT ('F') NOT NULL,
    [C_KIRSZOLGALTATASTIPUSID]       INT             NULL,
    [C_FELADATELLATASIHELYID]        INT             NULL,
    [C_INTEZMENYID]                  INT             NOT NULL,
    [C_TANEVID]                      INT             NOT NULL,
    [TOROLT]                         CHAR (1)        DEFAULT ('F') NOT NULL,
    [SERIAL]                         INT             DEFAULT ((0)) NOT NULL,
    [LASTCHANGED]                    DATETIME        DEFAULT (getdate()) NOT NULL,
    [CREATED]                        DATETIME        DEFAULT (getdate()) NOT NULL,
    [MODIFIER]                       INT             NULL,
    [CREATOR]                        INT             NULL,
    [ELOZOTANEVIREKORDID]            INT             NULL,
    [NNID]                           INT             NULL,
    CONSTRAINT [tmp_ms_xx_constraint_PK_T_40273631] PRIMARY KEY CLUSTERED ([ID] ASC)
);

IF EXISTS (SELECT TOP 1 1 
           FROM   [dbo].[T_NEBULO])
    BEGIN
        SET IDENTITY_INSERT [dbo].[tmp_ms_xx_T_NEBULO] ON;
        INSERT INTO [dbo].[tmp_ms_xx_T_NEBULO] ([ID], [C_ALLAMPOLGARSAGA], [C_ALLAMPOLGARSAGA2], [C_ANYANYELVE], [C_AZISKOLAALAKOHELYETOLEGYKILO], [C_EDESANYJASZULETESICSALADINEV], [C_EDESANYJASZULETESIUTONEVE], [C_ELETVITELSZERUOTTLAKASKORZET], [C_ELOTAG], [C_ETIKAHITERKOLCSTAN], [C_FELVETELSTATUSZA], [C_KEPVISELOCIMEAZONOS], [C_MEGJEGYZES], [C_NEME], [C_OKTATASIAZONOSITOSZAMA], [C_OVODAAZONOSITO], [C_OVODANEVE], [C_SZAKERTOIBIZOTTSAGKORMANYHIV], [C_SZULETESICSALADINEVE], [C_SZULETESIHELY], [C_SZULETESIIDO], [C_SZULETESIORSZAG], [C_SZULETESIUTONEVE], [C_SZULOJENEKMUNKAHELYEAZISKOLA], [C_SZULOJETESTVERETARTOSANBETEG], [C_TAGOZAT], [C_TANULOCSALADINEVE], [C_TANULOUTONEVE], [C_TESTVEREAZINTEZMENYTANULOJA], [C_TKEMAILCIM], [C_TKNEVE], [C_TKROKONSAGIFOKA], [C_TKTELEFON], [C_AJTO], [C_EMELET], [C_HAZSZAM], [C_HELYSEGNEV], [C_IRANYITOSZAM], [C_KOZTERULETJELLEGE], [C_KOZTERULETNEV], [C_TKAJTO], [C_TKEMELET], [C_TKHAZSZAM], [C_TKHELYSEGNEV], [C_TKIRANYITOSZAM], [C_TKKOZTERULETJELLEGE], [C_TKKOZTERULETNEV], [C_BTM], [C_BTMLETSZAMSULY], [C_SNI], [C_SNILETSZAMSULY], [C_THAJTO], [C_THHAZSZAM], [C_THHELYSEGNEV], [C_THIRANYITOSZAM], [C_THKOZTERULETJELLEGE], [C_THKOZTERULETNEV], [C_THEMELET], [C_TARTOZKODASIHELYAZONOS], [C_KEPVISELO2CIMEAZONOS], [C_TKAJTO2], [C_TKEMAILCIM2], [C_TKEMELET2], [C_TKHAZSZAM2], [C_TKHELYSEGNEV2], [C_TKIRANYITOSZAM2], [C_TKKOZTERULETJELLEGE2], [C_TKKOZTERULETNEV2], [C_TKNEVE2], [C_TKROKONSAGIFOKA2], [C_TKTELEFON2], [C_ERTESITESDATUMA], [C_IMPORTALT], [C_FELADATELLATASIHELYID], [C_INTEZMENYID], [C_TANEVID], [TOROLT], [SERIAL], [LASTCHANGED], [CREATED], [MODIFIER], [CREATOR], [ELOZOTANEVIREKORDID], [NNID])
        SELECT   [ID],
                 [C_ALLAMPOLGARSAGA],
                 [C_ALLAMPOLGARSAGA2],
                 [C_ANYANYELVE],
                 [C_AZISKOLAALAKOHELYETOLEGYKILO],
                 [C_EDESANYJASZULETESICSALADINEV],
                 [C_EDESANYJASZULETESIUTONEVE],
                 [C_ELETVITELSZERUOTTLAKASKORZET],
                 [C_ELOTAG],
                 [C_ETIKAHITERKOLCSTAN],
                 [C_FELVETELSTATUSZA],
                 [C_KEPVISELOCIMEAZONOS],
                 [C_MEGJEGYZES],
                 [C_NEME],
                 [C_OKTATASIAZONOSITOSZAMA],
                 [C_OVODAAZONOSITO],
                 [C_OVODANEVE],
                 [C_SZAKERTOIBIZOTTSAGKORMANYHIV],
                 [C_SZULETESICSALADINEVE],
                 [C_SZULETESIHELY],
                 [C_SZULETESIIDO],
                 [C_SZULETESIORSZAG],
                 [C_SZULETESIUTONEVE],
                 [C_SZULOJENEKMUNKAHELYEAZISKOLA],
                 [C_SZULOJETESTVERETARTOSANBETEG],
                 [C_TAGOZAT],
                 [C_TANULOCSALADINEVE],
                 [C_TANULOUTONEVE],
                 [C_TESTVEREAZINTEZMENYTANULOJA],
                 [C_TKEMAILCIM],
                 [C_TKNEVE],
                 [C_TKROKONSAGIFOKA],
                 [C_TKTELEFON],
                 [C_AJTO],
                 [C_EMELET],
                 [C_HAZSZAM],
                 [C_HELYSEGNEV],
                 [C_IRANYITOSZAM],
                 [C_KOZTERULETJELLEGE],
                 [C_KOZTERULETNEV],
                 [C_TKAJTO],
                 [C_TKEMELET],
                 [C_TKHAZSZAM],
                 [C_TKHELYSEGNEV],
                 [C_TKIRANYITOSZAM],
                 [C_TKKOZTERULETJELLEGE],
                 [C_TKKOZTERULETNEV],
                 [C_BTM],
                 [C_BTMLETSZAMSULY],
                 [C_SNI],
                 [C_SNILETSZAMSULY],
                 [C_THAJTO],
                 [C_THHAZSZAM],
                 [C_THHELYSEGNEV],
                 [C_THIRANYITOSZAM],
                 [C_THKOZTERULETJELLEGE],
                 [C_THKOZTERULETNEV],
                 [C_THEMELET],
                 [C_TARTOZKODASIHELYAZONOS],
                 [C_KEPVISELO2CIMEAZONOS],
                 [C_TKAJTO2],
                 [C_TKEMAILCIM2],
                 [C_TKEMELET2],
                 [C_TKHAZSZAM2],
                 [C_TKHELYSEGNEV2],
                 [C_TKIRANYITOSZAM2],
                 [C_TKKOZTERULETJELLEGE2],
                 [C_TKKOZTERULETNEV2],
                 [C_TKNEVE2],
                 [C_TKROKONSAGIFOKA2],
                 [C_TKTELEFON2],
                 [C_ERTESITESDATUMA],
                 [C_IMPORTALT],
                 [C_FELADATELLATASIHELYID],
                 [C_INTEZMENYID],
                 [C_TANEVID],
                 [TOROLT],
                 [SERIAL],
                 [LASTCHANGED],
                 [CREATED],
                 [MODIFIER],
                 [CREATOR],
                 [ELOZOTANEVIREKORDID],
                 [NNID]
        FROM     [dbo].[T_NEBULO]
        ORDER BY [ID] ASC;
        SET IDENTITY_INSERT [dbo].[tmp_ms_xx_T_NEBULO] OFF;
    END

DROP TABLE [dbo].[T_NEBULO];

EXECUTE sp_rename N'[dbo].[tmp_ms_xx_T_NEBULO]', N'T_NEBULO';

EXECUTE sp_rename N'[dbo].[tmp_ms_xx_constraint_PK_T_40273631]', N'PK_T_4027363', N'OBJECT';

COMMIT TRANSACTION;

SET TRANSACTION ISOLATION LEVEL READ COMMITTED;


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027364]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027364]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_ALLAMPOLGARSAGA] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027365]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027365]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_ALLAMPOLGARSAGA2] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027366]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027366]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_ANYANYELVE] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027373]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027373]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_FELVETELSTATUSZA] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027376]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027376]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_NEME] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027384]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027384]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_SZULETESIORSZAG] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027388]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027388]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_TAGOZAT] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027394]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027394]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_TKROKONSAGIFOKA] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027407]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027407]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_KOZTERULETJELLEGE] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027414]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027414]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_TKKOZTERULETJELLEGE] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027483]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027483]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_THKOZTERULETJELLEGE] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027499]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027499]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_TKKOZTERULETJELLEGE2] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4027502]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4027502]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_TKROKONSAGIFOKA2] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027363_4028311]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027363_4028311]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC, [C_TANEVID] ASC, [C_KIRSZOLGALTATASTIPUSID] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_4027460_4027459]...';


GO
CREATE NONCLUSTERED INDEX [I_T_4027460_4027459]
    ON [dbo].[T_NEBULO]([C_FELADATELLATASIHELYID] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_402736302_402736300]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402736302_402736300]
    ON [dbo].[T_NEBULO]([C_INTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_NEBULO].[I_T_402736305_402736303]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402736305_402736303]
    ON [dbo].[T_NEBULO]([C_TANEVID] ASC);


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


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


GO
PRINT N'Creating [dbo].[T_KIRSZOLGALTATASTIPUS].[I_T_402831202_402831200]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402831202_402831200]
    ON [dbo].[T_KIRSZOLGALTATASTIPUS]([C_ALINTEZMENYID] ASC);


GO
PRINT N'Creating [dbo].[T_KIRSZOLGALTATASTIPUS].[I_T_402831205_402831203]...';


GO
CREATE NONCLUSTERED INDEX [I_T_402831205_402831203]
    ON [dbo].[T_KIRSZOLGALTATASTIPUS]([C_ALTANEVID] ASC);


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


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


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


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


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027460_4027459] FOREIGN KEY ([C_FELADATELLATASIHELYID]) REFERENCES [dbo].[T_FELADATELLATASIHELY] ([ID]);


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


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


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


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


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027364] FOREIGN KEY ([C_ALLAMPOLGARSAGA], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ALLAMPOLGARSAG] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027365] FOREIGN KEY ([C_ALLAMPOLGARSAGA2], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ALLAMPOLGARSAG] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027366] FOREIGN KEY ([C_ANYANYELVE], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ANYANYELV] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027373] FOREIGN KEY ([C_FELVETELSTATUSZA], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_FELVETELSTATUSZATIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027376] FOREIGN KEY ([C_NEME], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_NEM] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027384] FOREIGN KEY ([C_SZULETESIORSZAG], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ORSZAGTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027388] FOREIGN KEY ([C_TAGOZAT], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_TAGOZATTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027394] FOREIGN KEY ([C_TKROKONSAGIFOKA], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ROKONSAGIFOK] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027407] FOREIGN KEY ([C_KOZTERULETJELLEGE], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_KOZTERULETJELLEG] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027414] FOREIGN KEY ([C_TKKOZTERULETJELLEGE], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_KOZTERULETJELLEG] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027483] FOREIGN KEY ([C_THKOZTERULETJELLEGE], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_KOZTERULETJELLEG] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027499] FOREIGN KEY ([C_TKKOZTERULETJELLEGE2], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_KOZTERULETJELLEG] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4027502] FOREIGN KEY ([C_TKROKONSAGIFOKA2], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_ROKONSAGIFOK] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH NOCHECK
    ADD CONSTRAINT [FK_4027363_4028311] FOREIGN KEY ([C_KIRSZOLGALTATASTIPUSID], [C_INTEZMENYID], [C_TANEVID]) REFERENCES [dbo].[T_KIRSZOLGALTATASTIPUS] ([ID], [C_ALINTEZMENYID], [C_ALTANEVID]);


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


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


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


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


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


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


GO
PRINT N'Refreshing [dbo].[T_NEBULO_OSSZES]...';


GO
EXECUTE sp_refreshsqlmodule N'[dbo].[T_NEBULO_OSSZES]';


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


GO
ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027460_4027459];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_402736302_402736300];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_402736305_402736303];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027364];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027365];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027366];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027373];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027376];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027384];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027388];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027394];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027407];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027414];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027483];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027499];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4027502];

ALTER TABLE [dbo].[T_NEBULO] WITH CHECK CHECK CONSTRAINT [FK_4027363_4028311];

ALTER TABLE [dbo].[T_KIRSZOLGALTATASTIPUS] WITH CHECK CHECK CONSTRAINT [FK_T_21038_4028313];

ALTER TABLE [dbo].[T_KIRSZOLGALTATASTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402831202_402831200];

ALTER TABLE [dbo].[T_KIRSZOLGALTATASTIPUS] WITH CHECK CHECK CONSTRAINT [FK_402831205_402831203];


GO
PRINT N'Update complete.';
