I ended up with this, it solves the case.
with calendar as
( select cast('2005-01-01' as date) as [Date], 2022 as [Year], 1 as [Month], 1
as [Day]
union all
select dateadd(day,1,[Date]), DATEPART(year,dateadd(day,1,[Date])),
DATEPART(MONTH,dateadd(day,1,[Date])), DATEPART(DAY,dateadd(day,1,[Date]))
from calendar
where [Date] <= '2030-12-31'
)
select c.*,
CASE c.month when 1 then SUBSTRING(t.TFACS_MON01,c.Day,1)
when 2 then
SUBSTRING(t.TFACS_MON02,c.Day,1)
when 3 then
SUBSTRING(t.TFACS_MON03,c.Day,1)
when 4 then
SUBSTRING(t.TFACS_MON04,c.Day,1)
when 5 then
SUBSTRING(t.TFACS_MON05,c.Day,1)
when 6 then
SUBSTRING(t.TFACS_MON06,c.Day,1)
when 7 then
SUBSTRING(t.TFACS_MON07,c.Day,1)
when 8 then
SUBSTRING(t.TFACS_MON08,c.Day,1)
when 9 then
SUBSTRING(t.TFACS_MON09,c.Day,1)
when 10 then
SUBSTRING(t.TFACS_MON10,c.Day,1)
when 11 then
SUBSTRING(t.TFACS_MON11,c.Day,1)
when 12 then
SUBSTRING(t.TFACS_MON12,c.Day,1)
END as WorkDay
from calendar c
join [TFACS] t on t.TFACS_JAHR = c.Year
ORDER BY Date
OPTION(MAXRECURSION 30000)