Thursday, August 04, 2005 12:28 PM
szurgot
Nice little SQL Server Cheat - Using GetDate() in a user defined function
As a rule, I prefer not to "cheat" when coding, but this one problem has pestered me enough, and has always seemed like something you should be able to do... Use GetDate() in a user defined function. You can't, because it's "non-deterministic" Bah. If I want to use the timestamp in a function, I should be able to. At any rate, a little digging on google today turned up this article, which basically says put the function in a view, and call the view from the UDF.
Thought I'd pass it along for anyone else who wants to do this.