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)

SQL Function, SQL Scripts
Previous Post
SQL SERVER – FIX : Error 7311 – You may receive an error message when you try to run distributed queries from a 64-bit SQL Server 2005 client to a linked 32-bit SQL Server 2000 server or to a linked SQL Server 7.0 server
Next Post
SQL SERVER 2005 – Microsoft Will Release SP3 Soon

Related Posts

Leave a Reply