Monday, July 12, 2010

SQL SERVER – Deterministic Functions and Nondeterministic Functions

Deterministic functions always returns the same output result all the time it is executed for same input values। i.e. ABS, DATEDIFF, ISNULL etc.


Nondeterministic functions may return different results each time they are executed. i.e. NEWID, RAND, @@CPU_BUSY etc. Functions that call extended stored procedures are nondeterministic. User-defined functions that create side effects on the database are not recommended.

3 comments :