Suggest an editImprove this articleRefine the answer for “What is a non-deterministic function?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A **non-deterministic function** is a function that **can return different results for the same input**: its result depends not just on its arguments, but also on **external factors** - time, database state, random values, and so on, e.g. `RAND()`, `GETDATE()`, `NEWID()`. **Key point:** non-deterministic functions **can't be cached** or used in indexes; they're indispensable when you need a unique, random, or current-moment result, but unsuited to logic that requires stability.Shown above the full answer for quick recall.Answer (EN)ImageA **non-deterministic function** is a function that **can return different results for the same input**. Its result depends not just on its arguments, but also on **external factors** - time, database state, random values, and so on. ### Examples of non-deterministic functions ```sql SELECT GETDATE(); -- the current time, changes every second SELECT RAND(); -- a random number SELECT NEWID(); -- a random unique identifier ``` Even called with the same parameters, the result comes out different. ### Why this matters - Non-deterministic functions **can't be cached** or used in indexes. - They're **indispensable** when you need a unique, random, or current-moment result, but **unsuited** to logic that requires stability.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.