Can we create a function in SQL Server to be deterministic and precise without CLR?
CREATE FUNCTION ufn_max_smalldatetime ()
RETURNS SMALLDATETIME
WITH SCHEMABINDING
AS
BEGIN
RETURN CAST('2079-06-06' AS SMALLDATETIME)
END
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As far as I know SQL Server determines itself whether your function is deterministic and/or precise. Try running the following queries and see what you get: