initial commit

This commit is contained in:
Peter Wood
2022-07-15 15:37:20 -04:00
parent 70a85b6024
commit 27e7c7829c
13 changed files with 249 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
use Leo
go
alter proc dbo.proc_UpdateHolidaysTable
as
if not exists(select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'HOLIDAYS')
create table dbo.HOLIDAYS(dt date primary key clustered, Holiday varchar(50))
declare @year int = 2019
while @year < year(getdate()) + 40
begin
insert into dbo.Holidays(dt, Holiday)
select fhol.dt, fhol.Holiday
from
dbo.tvf_GetHolidays(@year) fhol
left join dbo.Holidays tbh on fhol.dt = tbh.dt
where fhol.dt is null
set @year = @year + 1
end
go