SQL SERVER – Function Property – Deterministic or Non-Deterministic

I recently received question through email that how to determine if any user defined function is deterministic or non-deterministic?

First go through two articles I have written about deterministic and non-deterministic function.

SQL SERVER – Deterministic Functions and Nondeterministic Functions

SQL SERVER – 2005 – Use of Non-deterministic Function in UDF – Find Day Difference Between Any Date and Today

You can run following code to determine if function is deterministic or not.

SELECT
OBJECTPROPERTY(OBJECT_ID('dbo.ufnGetAccountingStartDate'),
'IsDeterministic'
) IsFunctionDeterministic

Reference : Pinal Dave (https://blog.sqlauthority.com)

Menu
Exit mobile version