Sometimes, I have to use function to define a constant in SQL Server. However, it doesn't perform as well as just plugging in constant value in there. Why can't we just have constant value in T-SQL? Don't tell me that there is a deterministic function. Most of the time, SQL Server just keeps calling the function although it does know that the function is deterministic.