O'Reilly logo

Writing Stored Procedures for Microsoft SQL Server by Matthew Shepker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Function Determinism

All functions that exist in SQL Server are either deterministic or nondeterministic. The determinism of a function is defined by the data that is returned by the function. The following outlines the determinism of a function:

  • A function is considered deterministic if it always returns the same result set when it's called with the same set of input values.

  • A function is considered nondeterministic if it doesn't always return the same result every time it's called with the same set of input values .

This might sound somewhat complicated, but it really isn't. Take, for example, the DATEDIFF and GETDATE functions. DATEDIFF is deterministic because it will always return the same data every time it's run with the same input parameters. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required