This documentation is archived and is not being maintained.

SqlMethodAttribute.IsMutator Property

Indicates whether a method on a user-defined type (UDT) is a mutator.

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

public bool IsMutator { get; set; }

Property Value

Type: System.Boolean
true if the method is a mutator; otherwise false.

If the IsMutator property is set to true and the return type of the method is void, SQL Server marks the method as a mutator. A mutator method is one that causes a state change in the UDT instance. Mutator methods can be called in assignment statements or data modification statements, but cannot be used in queries. If a method is marked as a mutator but does not return void, then CREATE TYPE does not fail with an error. Even though a returned value other than void does not raise an error, the returned value is not accessible and cannot be used.

The default value of the IsMutator property is false.

A property can be a mutator if SqlMethodAttribute is used on the setter and IsMutator is set to true. However, a property setter is implicitly treated as a mutator, so it is not necessary to set the IsMutator property of the SqlMethodAttribute to true.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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