Since you like giving me programmign assignments, would you post code to compute "the whole shebang" for the Student’s T-distribution? The formula and a look-up are at:
Now, do not use a look-up table! Just use your proprietary T-SQL functions.
The reason I mention the Student T distribution is that I started life as a FORTRAN programmer doing stats. When I needed the student T, I actually had written a subroutine for it! So when I got to SQL, I wanted to keep my old paradigm. I tried to copy my subroutine into T-SQL!
This was a bad idea. SQL is not a computational language (for mathematics or for temporal).
Somewhere around here, I have a CD with the calendar table, written in ANSI/ISO standard DDL and insert statements. When I go on a job, I do not care if it is T-SQL, DB2, Oracle, PostGres, Teradata, Informix, or an SQL product I have never worked on before in my life.
I create and load a calendar table, and a series table and perhaps some other things (like the Student T) for that job.
Initially I was worried about using too much storage. Today, 1 million rows in the table is nothing and primary storage is larger than the secondary storage we had when I started.