sql - "Non-deterministic User-Defined functions can be used in a deterministic manner"是什么意思?

标签 sql sql-server user-defined-functions deterministic non-deterministic

根据 Deterministic and Nondeterministic Functions 上的 MSDN SQL BOL(联机丛书)页面,非确定性函数可以“以确定性方式使用”

The following functions are not always deterministic, but can be used in indexed views or indexes on computed columns when they are specified in a deterministic manner.

非确定性函数可以以确定性方式使用是什么意思?
有人可以说明如何可以做到这一点吗?以及在哪里您会这样做?

最佳答案

函数是确定性的意味着它保证始终为相同的输入参数返回相同的输出值。

我认为以确定性方式使用非确定性函数意味着您确保传递给函数的参数范围使得返回值是确定性的,即。仅依赖于这些论点。

这在实践中意味着什么取决于函数的作用以及它的不确定性。

关于sql - "Non-deterministic User-Defined functions can be used in a deterministic manner"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/709601/

相关文章:

arrays - 将字符串值的 Redshift super 数组转换为逗号分隔的字符串

php - 如何在 Mysql 表中找到匹配的数据行?

java - 更新查询在 mysql 中有效,但在 netbeans 中无效

sql-server - 包验证错误

php - Symfony2 处理不在关系中的查询

SQL 查询将两列合并为一列

python - 正在分析 pyspark udf 打印行

java - SQL JSON 列(忽略大小写)

mysql - 触发器中的语法不正确

VBA UDF 更改所有工作表上的值。怎么限制为1?