Export (0) Print
Expand All

SqlFunctionAttribute.IsDeterministic Property

Indicates whether the user-defined function is deterministic.

Namespace:  Microsoft.SqlServer.Server
Assembly:  System.Data (in System.Data.dll)

'Declaration
Public Property IsDeterministic As Boolean

Property Value

Type: System.Boolean
true if the function is deterministic; otherwise false.

A user-defined function is said to be deterministic if it always produces the same output values given the same input values and the same database state.

The IsDeterministic property is also useful for indexing the result of the function in the form of indexed computed columns and indexed views. If this property is not specified, the function is assumed to be non-deterministic.

Functions that access local data can be deterministic. The data access characteristic is captured separately by the DataAccess and SystemDataAccess properties.

Note that data access to remote servers (for example, using a SqlConnection to connect to another SQL Server instance) is available in user-defined functions. However, you must still honor the IsDeterministic declaration. If the common language runtime (CLR) function is marked as deterministic, it should not cause side-effects in the remote server. While side-effects against the context connection are restricted, SQL Server will not enforce the restriction for side-effects over remote connections.

The default value of this attribute is false.

Do not mark a function as deterministic if the function does not always produce the same output values, given the same input values and the same database state. Marking a function as deterministic when the function is not truly deterministic can result in corrupted indexed views and computed columns.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft