This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,64 @@
--Migration
truncate table T_ORARENDTELJES
go
alter table T_ORARENDTELJES drop constraint PK_OrarendTeljes
go
alter table T_ORARENDTELJES
alter column C_DATUM date not null
alter table T_ORARENDTELJES
alter column C_NAPDATUMA date null
alter table T_ORARENDTELJES
alter column C_ORAERVENYESSEGKEZDETE date not null
alter table T_ORARENDTELJES
alter column C_ORAERVENYESSEGVEGE date not null
alter table T_ORARENDTELJES
alter column C_ORAKEZDETE time not null
alter table T_ORARENDTELJES
alter column C_ORAVEGE time not null
alter table T_ORARENDTELJES
alter column C_ORASZAM tinyint null
alter table T_ORARENDTELJES
alter column C_INTEZMENYID smallint not null
alter table T_ORARENDTELJES
alter column C_TANEVID smallint not null
alter table T_ORARENDTELJES
alter column C_HETSORSZAMA tinyint null
alter table T_ORARENDTELJES
add CREATED smalldatetime not null default (GETDATE())
alter table T_ORARENDTELJES
add LASTCHANGED smalldatetime not null default (GETDATE())
go
exec dev.uspCreateSchemaViews 'T_ORARENDTELJES';
go
DROP INDEX IF EXISTS [NCI_Felhasznalo_IntezmenyId_TanevId_Neme] ON [dbo].[T_FELHASZNALO]
GO
CREATE NONCLUSTERED INDEX [NCI_Felhasznalo_IntezmenyId_TanevId_Neme] ON [dbo].[T_FELHASZNALO]
(
[C_INTEZMENYID] ASC,
[C_TANEVID] ASC,
[C_NEME] ASC
)
INCLUDE(C_NYOMTATASINEV, C_IDPEGYEDIAZONOSITO)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
GO
alter table T_ORARENDTELJES
add constraint PK_OrarendTeljes primary key clustered (C_INTEZMENYID, C_TANEVID, C_DATUM, C_ORARENDIORAID)
with (fillfactor = 100, data_compression = row)
go

View file

@ -0,0 +1,34 @@
set ansi_warnings off;
declare @IntezmenyId int, @TanevId int;
declare @cursor cursor;
set @cursor = cursor static for
select i.ID as INTEZMENYID, t.ID as TANEVID
from T_INTEZMENY i
inner join T_TANEV t on t.C_INTEZMENYID = i.ID
where i.TOROLT = 'F'
and t.TOROLT = 'F'
and t.C_AKTIV = 'T'
order by 1, 2;
truncate table T_ORARENDTELJES;
open @cursor;
fetch next from @cursor into @IntezmenyId, @TanevId;
while(@@fetch_status = 0)
begin
print concat('Orarend: ', @IntezmenyId, ', ', @TanevId);
exec dbo.uspGenerateTeljesOrarend @IntezmenyId, @TanevId;
fetch next from @cursor into @IntezmenyId, @TanevId;
end
close @cursor;
go
alter index all on T_ORARENDTELJES rebuild;
go
set ansi_warnings on;