What is the difference between Deterministic and Non deterministic functions?

Deterministic vs Non deterministic functions:

 A function is deterministic, when it returns the same result every time for the same set of argument values. 

For example adding two specific numbers returns the same output  at anytime.

Ex: Sum(), Avg(), Floor(), Ceil(), Round()….etc

 A function is non-deterministic, when it returns the different result each time for the same set of argument values. 

For example selecting the current date time returns the different result every time we run the function.  

Ex: Getdate(), Rank(), Row_Number()….etc

Happy Reading :)

Leave a Reply

Your email address will not be published. Required fields are marked *