Share via


EventField.TypeModifier Property

Gets or sets the optional Microsoft SQL Server field attributes for an event field.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public Property TypeModifier As String
public string TypeModifier { get; set; }
public:
property String^ TypeModifier {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_TypeModifier ()

/** @property */
public void set_TypeModifier (String value)
public function get TypeModifier () : String

public function set TypeModifier (value : String)

Property Value

A String, between 1 and 255 characters in length, that specifies the type modifiers for the event field.

Remarks

Field type modifiers are equivalent to table column modifiers, such as NOT NULL or DEFAULT constant_expression. The value must conform to the Transact-SQL syntax conventions.

You cannot specify an event data field as an Identity column in SQL Server. Notification Services already uses the Identity property to specify a system-generated EventId field.

For more information about possible values, see CREATE TABLE (Transact-SQL).

If you update a field type modifier, updating the application deletes and re-creates the event class to which it corresponds. This includes dropping and re-creating the SQL Server tables and indexes used by this event class. Any data existing in the original event class tables is permanently deleted.

Example

The following examples show how to define an event field that does not allow null values:

// Add an orgin field to the end of the field collection
EventField eventOrgin = 
    new EventField(flightEvents, "LeavingFrom");
eventOrgin.Type = "nvarchar(6)";
eventOrgin.TypeModifier = "not null";
flightEvents.EventFields.Add(eventOrgin);
' Add an orgin field to the end of the field collection.
Dim eventOrgin As EventField = _
    New EventField(flightEvents, "LeavingFrom")
eventOrgin.Type = "nvarchar(6)"
eventOrgin.TypeModifier = "not null"
flightEvents.EventFields.Add(eventOrgin)

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

EventField Class
EventField Members
Microsoft.SqlServer.Management.Nmo Namespace

Other Resources

Defining Core Event Class Properties
FieldTypeMods Element for EventClass/Schema/Field (ADF)