Deterministic and Nondeterministic Functions

Some functions always return the same value when called with the same set of arguments. These functions are called deterministic. This is important if you want to create a clustered index on a view or any index on a computed column, because you can create these indexes only if they use deterministic functions.

Most of the built-in functions are deterministic, such as

ABS DATEDIFF PARSENAME
ACOS DAY POWER
ASIN DEGREES RADIANS
ATAN EXP ROUND
ATN2 FLOOR SIGN
CEILING ISNULL SIN
COALESCE ISNUMERIC SQUARE
COS LOG SQRT
COT LOG10 TAN
DATALENGTH MONTH YEAR
DATEADD NULLIF  

Some built-in functions are deterministic or nondeterministic, depending on the way you use them:

  • CAST is deterministic for every type ...

Get Microsoft® SQL Server™ 2000 Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.