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.
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
EventField Class
EventField Members
Microsoft.SqlServer.Management.Nmo Namespace
其他資源
定義核心事件類別屬性
FieldTypeMods Element for EventClass/Schema/Field (ADF)