SqlMethodAttribute.IsMutator Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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
Available since 2.0
Return to top