SqlUserDefinedAggregateAttribute.IsInvariantToNulls 属性

定义

指示聚合是否与空值无关。Indicates whether the aggregate is invariant to nulls.

public:
 property bool IsInvariantToNulls { bool get(); void set(bool value); };
public bool IsInvariantToNulls { get; set; }
member this.IsInvariantToNulls : bool with get, set
Public Property IsInvariantToNulls As Boolean

属性值

如果聚合与空值无关,则为 true;否则为 falsetrue if the aggregate is invariant to nulls; otherwise false.

注解

如果聚合与 null 值无关,则查询处理器使用此属性 trueUsed by the query processor, this property is true if the aggregate is invariant to nulls. 也就是说,S、{NULL} 的聚合与的聚合相同。例如,聚合函数(如 MIN 和 MAX)满足此属性,而 COUNT (*)则不满足此属性。That is, the aggregate of S, {NULL} is the same as aggregate of S. For example, aggregate functions such as MIN and MAX satisfy this property, while COUNT(*) does not.

错误设置此属性可能会导致不正确的查询结果。Incorrectly setting this property can result in incorrect query results. 此属性不是优化器提示;它会影响选定的计划和查询返回的结果。This property is not an optimizer hint; it affects the plan selected and the results returned by the query.

适用于