/*==============================================================*/ /* DBMS name: Microsoft SQL Server 2008 */ /* Created on: 2/12/2017 11:33:49 PM */ /*==============================================================*/ if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('ELOADAS_A_JATEKRENDBEN') and o.name = 'FK_ELOADAS__ELOADAS_A_TEREM') alter table ELOADAS_A_JATEKRENDBEN drop constraint FK_ELOADAS__ELOADAS_A_TEREM go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('ELOADAS_A_JATEKRENDBEN') and o.name = 'FK_ELOADAS__ELOADAS_P_ELOADAS') alter table ELOADAS_A_JATEKRENDBEN drop constraint FK_ELOADAS__ELOADAS_P_ELOADAS go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('E_P_SZEREPKORT_BETOLTO_SZEMELY') and o.name = 'FK_E_P_SZER_SZEMELY_A_SZI_SZER') alter table E_P_SZEREPKORT_BETOLTO_SZEMELY drop constraint FK_E_P_SZER_SZEMELY_A_SZI_SZER go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('E_P_SZEREPKORT_BETOLTO_SZEMELY') and o.name = 'FK_E_P_SZER_SZEMELY_E_SZEMELY') alter table E_P_SZEREPKORT_BETOLTO_SZEMELY drop constraint FK_E_P_SZER_SZEMELY_E_SZEMELY go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('FORDITO') and o.name = 'FK_FORDITO_FORDITO_SZINDARA') alter table FORDITO drop constraint FK_FORDITO_FORDITO_SZINDARA go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('FORDITO') and o.name = 'FK_FORDITO_FORDITO2_SZEMELY') alter table FORDITO drop constraint FK_FORDITO_FORDITO2_SZEMELY go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('HELYISEG') and o.name = 'FK_HELYISEG_TARTOZIK_ORSZAG') alter table HELYISEG drop constraint FK_HELYISEG_TARTOZIK_ORSZAG go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZEMELY') and o.name = 'FK_SZEMELY_TARTOZKOD_HELYISEG') alter table SZEMELY drop constraint FK_SZEMELY_TARTOZKOD_HELYISEG go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZEREPEL_AZ_ELOADASBAN') and o.name = 'FK_SZEREPEL_SZEREPEL__ELOADAS_') alter table SZEREPEL_AZ_ELOADASBAN drop constraint FK_SZEREPEL_SZEREPEL__ELOADAS_ go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZEREPEL_AZ_ELOADASBAN') and o.name = 'FK_SZEREPEL_SZEREPEL__E_P_SZER') alter table SZEREPEL_AZ_ELOADASBAN drop constraint FK_SZEREPEL_SZEREPEL__E_P_SZER go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZERZO') and o.name = 'FK_SZERZO_SZERZO_SZINDARA') alter table SZERZO drop constraint FK_SZERZO_SZERZO_SZINDARA go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZERZO') and o.name = 'FK_SZERZO_SZERZO2_SZEMELY') alter table SZERZO drop constraint FK_SZERZO_SZERZO2_SZEMELY go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZINDARAB') and o.name = 'FK_SZINDARA_SZI_MUFAJ_MUFAJ') alter table SZINDARAB drop constraint FK_SZINDARA_SZI_MUFAJ_MUFAJ go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZINDARAB_ELOADAS') and o.name = 'FK_SZINDARA_SZINDARAB_SZINDARA') alter table SZINDARAB_ELOADAS drop constraint FK_SZINDARA_SZINDARAB_SZINDARA go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZINDARAB_ELOADAS') and o.name = 'FK_SZINDARA_SZINDARAB_ELOADAS') alter table SZINDARAB_ELOADAS drop constraint FK_SZINDARA_SZINDARAB_ELOADAS go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZINHAZ') and o.name = 'FK_SZINHAZ_MUKODIK_HELYISEG') alter table SZINHAZ drop constraint FK_SZINHAZ_MUKODIK_HELYISEG go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZI_SZEREPKOR') and o.name = 'FK_SZI_SZER_SZI_SZERE_SZEREPKO') alter table SZI_SZEREPKOR drop constraint FK_SZI_SZER_SZI_SZERE_SZEREPKO go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZI_SZEREPKOR') and o.name = 'FK_SZI_SZER_SZI_SZERE_SZINDARA') alter table SZI_SZEREPKOR drop constraint FK_SZI_SZER_SZI_SZERE_SZINDARA go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZ_H_E_P') and o.name = 'FK_SZ_H_E_P_SZ_H_E_P_SZINHAZ') alter table SZ_H_E_P drop constraint FK_SZ_H_E_P_SZ_H_E_P_SZINHAZ go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('SZ_H_E_P') and o.name = 'FK_SZ_H_E_P_SZ_H_E_P2_ELOADAS') alter table SZ_H_E_P drop constraint FK_SZ_H_E_P_SZ_H_E_P2_ELOADAS go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('TEREM') and o.name = 'FK_TEREM_SZINHAZ_T_SZINHAZ') alter table TEREM drop constraint FK_TEREM_SZINHAZ_T_SZINHAZ go if exists (select 1 from sysobjects where id = object_id('ELOADAS') and type = 'U') drop table ELOADAS go if exists (select 1 from sysindexes where id = object_id('ELOADAS_A_JATEKRENDBEN') and name = 'ELOADAS_PROJEKT_A_JATEKRENDBEN_FK' and indid > 0 and indid < 255) drop index ELOADAS_A_JATEKRENDBEN.ELOADAS_PROJEKT_A_JATEKRENDBEN_FK go if exists (select 1 from sysindexes where id = object_id('ELOADAS_A_JATEKRENDBEN') and name = 'ELOADAS_A_TEREMBEN_FK' and indid > 0 and indid < 255) drop index ELOADAS_A_JATEKRENDBEN.ELOADAS_A_TEREMBEN_FK go if exists (select 1 from sysobjects where id = object_id('ELOADAS_A_JATEKRENDBEN') and type = 'U') drop table ELOADAS_A_JATEKRENDBEN go if exists (select 1 from sysindexes where id = object_id('E_P_SZEREPKORT_BETOLTO_SZEMELY') and name = 'SZEMELY_A_SZI_SZEREPKORBEN_FK' and indid > 0 and indid < 255) drop index E_P_SZEREPKORT_BETOLTO_SZEMELY.SZEMELY_A_SZI_SZEREPKORBEN_FK go if exists (select 1 from sysindexes where id = object_id('E_P_SZEREPKORT_BETOLTO_SZEMELY') and name = 'SZEMELY_E_P_SZEREPKOR_FK' and indid > 0 and indid < 255) drop index E_P_SZEREPKORT_BETOLTO_SZEMELY.SZEMELY_E_P_SZEREPKOR_FK go if exists (select 1 from sysobjects where id = object_id('E_P_SZEREPKORT_BETOLTO_SZEMELY') and type = 'U') drop table E_P_SZEREPKORT_BETOLTO_SZEMELY go if exists (select 1 from sysindexes where id = object_id('FORDITO') and name = 'FORDITO_FK' and indid > 0 and indid < 255) drop index FORDITO.FORDITO_FK go if exists (select 1 from sysindexes where id = object_id('FORDITO') and name = 'FORDITO2_FK' and indid > 0 and indid < 255) drop index FORDITO.FORDITO2_FK go if exists (select 1 from sysobjects where id = object_id('FORDITO') and type = 'U') drop table FORDITO go if exists (select 1 from sysindexes where id = object_id('HELYISEG') and name = 'TARTOZIK_FK' and indid > 0 and indid < 255) drop index HELYISEG.TARTOZIK_FK go if exists (select 1 from sysobjects where id = object_id('HELYISEG') and type = 'U') drop table HELYISEG go if exists (select 1 from sysobjects where id = object_id('MUFAJ') and type = 'U') drop table MUFAJ go if exists (select 1 from sysobjects where id = object_id('ORSZAG') and type = 'U') drop table ORSZAG go if exists (select 1 from sysindexes where id = object_id('SZEMELY') and name = 'TARTOZKODIK_FK' and indid > 0 and indid < 255) drop index SZEMELY.TARTOZKODIK_FK go if exists (select 1 from sysobjects where id = object_id('SZEMELY') and type = 'U') drop table SZEMELY go if exists (select 1 from sysindexes where id = object_id('SZEREPEL_AZ_ELOADASBAN') and name = 'SZEREPEL_AZ_ELOADASBAN_FK' and indid > 0 and indid < 255) drop index SZEREPEL_AZ_ELOADASBAN.SZEREPEL_AZ_ELOADASBAN_FK go if exists (select 1 from sysindexes where id = object_id('SZEREPEL_AZ_ELOADASBAN') and name = 'SZEREPEL_AZ_ELOADASBAN2_FK' and indid > 0 and indid < 255) drop index SZEREPEL_AZ_ELOADASBAN.SZEREPEL_AZ_ELOADASBAN2_FK go if exists (select 1 from sysobjects where id = object_id('SZEREPEL_AZ_ELOADASBAN') and type = 'U') drop table SZEREPEL_AZ_ELOADASBAN go if exists (select 1 from sysobjects where id = object_id('SZEREPKOR') and type = 'U') drop table SZEREPKOR go if exists (select 1 from sysindexes where id = object_id('SZERZO') and name = 'SZERZO_FK' and indid > 0 and indid < 255) drop index SZERZO.SZERZO_FK go if exists (select 1 from sysindexes where id = object_id('SZERZO') and name = 'SZERZO2_FK' and indid > 0 and indid < 255) drop index SZERZO.SZERZO2_FK go if exists (select 1 from sysobjects where id = object_id('SZERZO') and type = 'U') drop table SZERZO go if exists (select 1 from sysindexes where id = object_id('SZINDARAB') and name = 'SZI_MUFAJA_FK' and indid > 0 and indid < 255) drop index SZINDARAB.SZI_MUFAJA_FK go if exists (select 1 from sysobjects where id = object_id('SZINDARAB') and type = 'U') drop table SZINDARAB go if exists (select 1 from sysindexes where id = object_id('SZINDARAB_ELOADAS') and name = 'SZINDARAB_ELOADAS_FK' and indid > 0 and indid < 255) drop index SZINDARAB_ELOADAS.SZINDARAB_ELOADAS_FK go if exists (select 1 from sysindexes where id = object_id('SZINDARAB_ELOADAS') and name = 'SZINDARAB_ELOADAS2_FK' and indid > 0 and indid < 255) drop index SZINDARAB_ELOADAS.SZINDARAB_ELOADAS2_FK go if exists (select 1 from sysobjects where id = object_id('SZINDARAB_ELOADAS') and type = 'U') drop table SZINDARAB_ELOADAS go if exists (select 1 from sysindexes where id = object_id('SZINHAZ') and name = 'MUKODIK_FK' and indid > 0 and indid < 255) drop index SZINHAZ.MUKODIK_FK go if exists (select 1 from sysobjects where id = object_id('SZINHAZ') and type = 'U') drop table SZINHAZ go if exists (select 1 from sysindexes where id = object_id('SZI_SZEREPKOR') and name = 'SZI_SZEREPKOR_FK' and indid > 0 and indid < 255) drop index SZI_SZEREPKOR.SZI_SZEREPKOR_FK go if exists (select 1 from sysindexes where id = object_id('SZI_SZEREPKOR') and name = 'SZI_SZEREPKOR2_FK' and indid > 0 and indid < 255) drop index SZI_SZEREPKOR.SZI_SZEREPKOR2_FK go if exists (select 1 from sysobjects where id = object_id('SZI_SZEREPKOR') and type = 'U') drop table SZI_SZEREPKOR go if exists (select 1 from sysindexes where id = object_id('SZ_H_E_P') and name = 'SZ_H_E_P_FK' and indid > 0 and indid < 255) drop index SZ_H_E_P.SZ_H_E_P_FK go if exists (select 1 from sysindexes where id = object_id('SZ_H_E_P') and name = 'SZ_H_E_P2_FK' and indid > 0 and indid < 255) drop index SZ_H_E_P.SZ_H_E_P2_FK go if exists (select 1 from sysobjects where id = object_id('SZ_H_E_P') and type = 'U') drop table SZ_H_E_P go if exists (select 1 from sysindexes where id = object_id('TEREM') and name = 'SZINHAZ_TERME_FK' and indid > 0 and indid < 255) drop index TEREM.SZINHAZ_TERME_FK go if exists (select 1 from sysobjects where id = object_id('TEREM') and type = 'U') drop table TEREM go /*==============================================================*/ /* Table: ELOADAS */ /*==============================================================*/ create table ELOADAS ( ELOADAS_AZ numeric identity, ELOADAS_CIME varchar(50) not null, EL_FELVONAS_SZAMA numeric(1) not null, EL_TARTALOM varchar(5000) null, EL_BEMUTATO_DATUM datetime not null, EL_HOSSZA_PERC numeric(3) not null, REPERTOARON bit not null, constraint PK_ELOADAS primary key nonclustered (ELOADAS_AZ) ) go /*==============================================================*/ /* Table: ELOADAS_A_JATEKRENDBEN */ /*==============================================================*/ create table ELOADAS_A_JATEKRENDBEN ( ELOADAS_AZ int not null, SZINHAZ_AZ int not null, TEREM_AZ int not null, ELOADAS_KEZDETE datetime not null, constraint PK_ELOADAS_A_JATEKRENDBEN primary key nonclustered (ELOADAS_AZ, SZINHAZ_AZ, TEREM_AZ, ELOADAS_KEZDETE) ) go /*==============================================================*/ /* Index: ELOADAS_A_TEREMBEN_FK */ /*==============================================================*/ create index ELOADAS_A_TEREMBEN_FK on ELOADAS_A_JATEKRENDBEN ( SZINHAZ_AZ ASC, TEREM_AZ ASC ) go /*==============================================================*/ /* Index: ELOADAS_PROJEKT_A_JATEKRENDBEN_FK */ /*==============================================================*/ create index ELOADAS_PROJEKT_A_JATEKRENDBEN_FK on ELOADAS_A_JATEKRENDBEN ( ELOADAS_AZ ASC ) go /*==============================================================*/ /* Table: E_P_SZEREPKORT_BETOLTO_SZEMELY */ /*==============================================================*/ create table E_P_SZEREPKORT_BETOLTO_SZEMELY ( SZEMELY_AZ int not null, SZEREPKOR_AZ int not null, SZINDARAB_AZ int not null, constraint PK_E_P_SZEREPKORT_BETOLTO_SZEM primary key nonclustered (SZEMELY_AZ, SZEREPKOR_AZ, SZINDARAB_AZ) ) go /*==============================================================*/ /* Index: SZEMELY_E_P_SZEREPKOR_FK */ /*==============================================================*/ create index SZEMELY_E_P_SZEREPKOR_FK on E_P_SZEREPKORT_BETOLTO_SZEMELY ( SZEMELY_AZ ASC ) go /*==============================================================*/ /* Index: SZEMELY_A_SZI_SZEREPKORBEN_FK */ /*==============================================================*/ create index SZEMELY_A_SZI_SZEREPKORBEN_FK on E_P_SZEREPKORT_BETOLTO_SZEMELY ( SZEREPKOR_AZ ASC, SZINDARAB_AZ ASC ) go /*==============================================================*/ /* Table: FORDITO */ /*==============================================================*/ create table FORDITO ( SZINDARAB_AZ int not null, SZEMELY_AZ int not null, constraint PK_FORDITO primary key nonclustered (SZINDARAB_AZ, SZEMELY_AZ) ) go /*==============================================================*/ /* Index: FORDITO2_FK */ /*==============================================================*/ create index FORDITO2_FK on FORDITO ( SZEMELY_AZ ASC ) go /*==============================================================*/ /* Index: FORDITO_FK */ /*==============================================================*/ create index FORDITO_FK on FORDITO ( SZINDARAB_AZ ASC ) go /*==============================================================*/ /* Table: HELYISEG */ /*==============================================================*/ create table HELYISEG ( HELYISEG_AZ numeric identity, ORSZAG_AZ int not null, HELYISEGNEV varchar(30) not null, H_IRANYITOSZAM numeric(5) not null, constraint PK_HELYISEG primary key nonclustered (HELYISEG_AZ) ) go /*==============================================================*/ /* Index: TARTOZIK_FK */ /*==============================================================*/ create index TARTOZIK_FK on HELYISEG ( ORSZAG_AZ ASC ) go /*==============================================================*/ /* Table: MUFAJ */ /*==============================================================*/ create table MUFAJ ( MUFAJ_AZON numeric identity, MUFAJ_NEVE varchar(50) not null, constraint PK_MUFAJ primary key nonclustered (MUFAJ_AZON) ) go /*==============================================================*/ /* Table: ORSZAG */ /*==============================================================*/ create table ORSZAG ( ORSZAG_AZ numeric identity, ORSZAGNEV varchar(30) not null, ORSZAG_JELZES char(5) null, constraint PK_ORSZAG primary key nonclustered (ORSZAG_AZ), constraint AK_ORSZAGNEV_UNIQUE_ORSZAG unique (ORSZAGNEV) ) go /*==============================================================*/ /* Table: SZEMELY */ /*==============================================================*/ create table SZEMELY ( SZEMELY_AZ numeric identity, HELYISEG_AZ int not null, SZE_VEZETEKNEV varchar(20) not null, SZE_NEV varchar(20) not null, NEME char(1) null constraint CKC_NEME_SZEMELY check (NEME is null or (NEME in ('',''))), SZE_ELETRAJZ varchar(5000) null, SZE_VAJDASAGI bit not null, SZE_AMATOR bit not null, SZE_AKTIV bit not null, constraint PK_SZEMELY primary key nonclustered (SZEMELY_AZ) ) go /*==============================================================*/ /* Index: TARTOZKODIK_FK */ /*==============================================================*/ create index TARTOZKODIK_FK on SZEMELY ( HELYISEG_AZ ASC ) go /*==============================================================*/ /* Table: SZEREPEL_AZ_ELOADASBAN */ /*==============================================================*/ create table SZEREPEL_AZ_ELOADASBAN ( SZEMELY_AZ int not null, SZEREPKOR_AZ int not null, SZINDARAB_AZ int not null, ELOADAS_AZ int not null, SZINHAZ_AZ int not null, TEREM_AZ int not null, ELOADAS_KEZDETE datetime not null, constraint PK_SZEREPEL_AZ_ELOADASBAN primary key nonclustered (SZEMELY_AZ, SZEREPKOR_AZ, SZINDARAB_AZ, ELOADAS_AZ, SZINHAZ_AZ, TEREM_AZ, ELOADAS_KEZDETE) ) go /*==============================================================*/ /* Index: SZEREPEL_AZ_ELOADASBAN2_FK */ /*==============================================================*/ create index SZEREPEL_AZ_ELOADASBAN2_FK on SZEREPEL_AZ_ELOADASBAN ( SZEMELY_AZ ASC, SZEREPKOR_AZ ASC, SZINDARAB_AZ ASC ) go /*==============================================================*/ /* Index: SZEREPEL_AZ_ELOADASBAN_FK */ /*==============================================================*/ create index SZEREPEL_AZ_ELOADASBAN_FK on SZEREPEL_AZ_ELOADASBAN ( ELOADAS_AZ ASC, SZINHAZ_AZ ASC, TEREM_AZ ASC, ELOADAS_KEZDETE ASC ) go /*==============================================================*/ /* Table: SZEREPKOR */ /*==============================================================*/ create table SZEREPKOR ( SZEREPKOR_AZ numeric identity, SZEREPKOR varchar(30) null, constraint PK_SZEREPKOR primary key nonclustered (SZEREPKOR_AZ) ) go /*==============================================================*/ /* Table: SZERZO */ /*==============================================================*/ create table SZERZO ( SZINDARAB_AZ int not null, SZEMELY_AZ int not null, constraint PK_SZERZO primary key nonclustered (SZINDARAB_AZ, SZEMELY_AZ) ) go /*==============================================================*/ /* Index: SZERZO2_FK */ /*==============================================================*/ create index SZERZO2_FK on SZERZO ( SZEMELY_AZ ASC ) go /*==============================================================*/ /* Index: SZERZO_FK */ /*==============================================================*/ create index SZERZO_FK on SZERZO ( SZINDARAB_AZ ASC ) go /*==============================================================*/ /* Table: SZINDARAB */ /*==============================================================*/ create table SZINDARAB ( SZINDARAB_AZ numeric identity, MUFAJ_AZON int not null, SZINDARAB_CIME varchar(50) not null, SZI_FELVONAS_SZAMA numeric(1) not null, constraint PK_SZINDARAB primary key nonclustered (SZINDARAB_AZ) ) go /*==============================================================*/ /* Index: SZI_MUFAJA_FK */ /*==============================================================*/ create index SZI_MUFAJA_FK on SZINDARAB ( MUFAJ_AZON ASC ) go /*==============================================================*/ /* Table: SZINDARAB_ELOADAS */ /*==============================================================*/ create table SZINDARAB_ELOADAS ( SZINDARAB_AZ int not null, ELOADAS_AZ int not null, constraint PK_SZINDARAB_ELOADAS primary key nonclustered (SZINDARAB_AZ, ELOADAS_AZ) ) go /*==============================================================*/ /* Index: SZINDARAB_ELOADAS2_FK */ /*==============================================================*/ create index SZINDARAB_ELOADAS2_FK on SZINDARAB_ELOADAS ( ELOADAS_AZ ASC ) go /*==============================================================*/ /* Index: SZINDARAB_ELOADAS_FK */ /*==============================================================*/ create index SZINDARAB_ELOADAS_FK on SZINDARAB_ELOADAS ( SZINDARAB_AZ ASC ) go /*==============================================================*/ /* Table: SZINHAZ */ /*==============================================================*/ create table SZINHAZ ( SZINHAZ_AZ numeric identity, HELYISEG_AZ int not null, SZINHAZNEV varchar(100) not null, SZ_H_CIM_IRANYITOSZAM numeric(5) not null, SZ_H_CIM_HELYSEG varchar(30) not null, SZ_H_CIM_UTCA_HSZ varchar(30) null, SZ_H_TELEFON varchar(20) null, SZ_H_WWW_CIM varchar(100) null, SZ_H_EMAIL varchar(50) null, SZ_H_VAJDASAGI bit not null, SZ_H_AMATOR bit not null, constraint PK_SZINHAZ primary key nonclustered (SZINHAZ_AZ) ) go /*==============================================================*/ /* Index: MUKODIK_FK */ /*==============================================================*/ create index MUKODIK_FK on SZINHAZ ( HELYISEG_AZ ASC ) go /*==============================================================*/ /* Table: SZI_SZEREPKOR */ /*==============================================================*/ create table SZI_SZEREPKOR ( SZEREPKOR_AZ int not null, SZINDARAB_AZ int not null, constraint PK_SZI_SZEREPKOR primary key nonclustered (SZEREPKOR_AZ, SZINDARAB_AZ) ) go /*==============================================================*/ /* Index: SZI_SZEREPKOR2_FK */ /*==============================================================*/ create index SZI_SZEREPKOR2_FK on SZI_SZEREPKOR ( SZINDARAB_AZ ASC ) go /*==============================================================*/ /* Index: SZI_SZEREPKOR_FK */ /*==============================================================*/ create index SZI_SZEREPKOR_FK on SZI_SZEREPKOR ( SZEREPKOR_AZ ASC ) go /*==============================================================*/ /* Table: SZ_H_E_P */ /*==============================================================*/ create table SZ_H_E_P ( SZINHAZ_AZ int not null, ELOADAS_AZ int not null, constraint PK_SZ_H_E_P primary key nonclustered (SZINHAZ_AZ, ELOADAS_AZ) ) go /*==============================================================*/ /* Index: SZ_H_E_P2_FK */ /*==============================================================*/ create index SZ_H_E_P2_FK on SZ_H_E_P ( ELOADAS_AZ ASC ) go /*==============================================================*/ /* Index: SZ_H_E_P_FK */ /*==============================================================*/ create index SZ_H_E_P_FK on SZ_H_E_P ( SZINHAZ_AZ ASC ) go /*==============================================================*/ /* Table: TEREM */ /*==============================================================*/ create table TEREM ( SZINHAZ_AZ int not null, TEREM_AZ numeric identity, TEREM_NEVE varchar(50) not null, TE_FEROHELYEK_SZAMA numeric(3) not null, constraint PK_TEREM primary key nonclustered (SZINHAZ_AZ, TEREM_AZ) ) go /*==============================================================*/ /* Index: SZINHAZ_TERME_FK */ /*==============================================================*/ create index SZINHAZ_TERME_FK on TEREM ( SZINHAZ_AZ ASC ) go alter table ELOADAS_A_JATEKRENDBEN add constraint FK_ELOADAS__ELOADAS_A_TEREM foreign key (SZINHAZ_AZ, TEREM_AZ) references TEREM (SZINHAZ_AZ, TEREM_AZ) go alter table ELOADAS_A_JATEKRENDBEN add constraint FK_ELOADAS__ELOADAS_P_ELOADAS foreign key (ELOADAS_AZ) references ELOADAS (ELOADAS_AZ) go alter table E_P_SZEREPKORT_BETOLTO_SZEMELY add constraint FK_E_P_SZER_SZEMELY_A_SZI_SZER foreign key (SZEREPKOR_AZ, SZINDARAB_AZ) references SZI_SZEREPKOR (SZEREPKOR_AZ, SZINDARAB_AZ) go alter table E_P_SZEREPKORT_BETOLTO_SZEMELY add constraint FK_E_P_SZER_SZEMELY_E_SZEMELY foreign key (SZEMELY_AZ) references SZEMELY (SZEMELY_AZ) go alter table FORDITO add constraint FK_FORDITO_FORDITO_SZINDARA foreign key (SZINDARAB_AZ) references SZINDARAB (SZINDARAB_AZ) go alter table FORDITO add constraint FK_FORDITO_FORDITO2_SZEMELY foreign key (SZEMELY_AZ) references SZEMELY (SZEMELY_AZ) go alter table HELYISEG add constraint FK_HELYISEG_TARTOZIK_ORSZAG foreign key (ORSZAG_AZ) references ORSZAG (ORSZAG_AZ) go alter table SZEMELY add constraint FK_SZEMELY_TARTOZKOD_HELYISEG foreign key (HELYISEG_AZ) references HELYISEG (HELYISEG_AZ) go alter table SZEREPEL_AZ_ELOADASBAN add constraint FK_SZEREPEL_SZEREPEL__ELOADAS_ foreign key (ELOADAS_AZ, SZINHAZ_AZ, TEREM_AZ, ELOADAS_KEZDETE) references ELOADAS_A_JATEKRENDBEN (ELOADAS_AZ, SZINHAZ_AZ, TEREM_AZ, ELOADAS_KEZDETE) go alter table SZEREPEL_AZ_ELOADASBAN add constraint FK_SZEREPEL_SZEREPEL__E_P_SZER foreign key (SZEMELY_AZ, SZEREPKOR_AZ, SZINDARAB_AZ) references E_P_SZEREPKORT_BETOLTO_SZEMELY (SZEMELY_AZ, SZEREPKOR_AZ, SZINDARAB_AZ) go alter table SZERZO add constraint FK_SZERZO_SZERZO_SZINDARA foreign key (SZINDARAB_AZ) references SZINDARAB (SZINDARAB_AZ) go alter table SZERZO add constraint FK_SZERZO_SZERZO2_SZEMELY foreign key (SZEMELY_AZ) references SZEMELY (SZEMELY_AZ) go alter table SZINDARAB add constraint FK_SZINDARA_SZI_MUFAJ_MUFAJ foreign key (MUFAJ_AZON) references MUFAJ (MUFAJ_AZON) go alter table SZINDARAB_ELOADAS add constraint FK_SZINDARA_SZINDARAB_SZINDARA foreign key (SZINDARAB_AZ) references SZINDARAB (SZINDARAB_AZ) go alter table SZINDARAB_ELOADAS add constraint FK_SZINDARA_SZINDARAB_ELOADAS foreign key (ELOADAS_AZ) references ELOADAS (ELOADAS_AZ) go alter table SZINHAZ add constraint FK_SZINHAZ_MUKODIK_HELYISEG foreign key (HELYISEG_AZ) references HELYISEG (HELYISEG_AZ) go alter table SZI_SZEREPKOR add constraint FK_SZI_SZER_SZI_SZERE_SZEREPKO foreign key (SZEREPKOR_AZ) references SZEREPKOR (SZEREPKOR_AZ) go alter table SZI_SZEREPKOR add constraint FK_SZI_SZER_SZI_SZERE_SZINDARA foreign key (SZINDARAB_AZ) references SZINDARAB (SZINDARAB_AZ) go alter table SZ_H_E_P add constraint FK_SZ_H_E_P_SZ_H_E_P_SZINHAZ foreign key (SZINHAZ_AZ) references SZINHAZ (SZINHAZ_AZ) go alter table SZ_H_E_P add constraint FK_SZ_H_E_P_SZ_H_E_P2_ELOADAS foreign key (ELOADAS_AZ) references ELOADAS (ELOADAS_AZ) go alter table TEREM add constraint FK_TEREM_SZINHAZ_T_SZINHAZ foreign key (SZINHAZ_AZ) references SZINHAZ (SZINHAZ_AZ) go