What do you mean, no external function calls

Have you ever been writing a function in SQLServer and tried to use the GetDate() function?

Didn’t work so well did it?

Well, while it may not be the best solution in the world, I am here to offer you a way around that little problem.

Create a view like so:

CREATE VIEW vCurrentDate as GETDATE() as CURRENT_DATE

Then anytime you need to pull the current date and time into a function, simply

SELECT TOP 1 CURRENT_DATE FROM vCurrentDate

poof