EventField.TypeModifier Property

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

Пространство имен: Microsoft.SqlServer.Management.Nmo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Синтаксис

'Декларация
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)

Значение свойства

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

Замечания

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.

Пример

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)

Синхронизация потоков

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.

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

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

Другие ресурсы

Определение свойств основного класса событий
FieldTypeMods Element for EventClass/Schema/Field (ADF)