共用方式為


SubscriptionField.TypeModifier Property

Gets or sets the optional Microsoft SQL Server field attributes for the subscription 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 subscription 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 a subscription field as an Identity column in SQL Server. Notification Services already uses the Identity property to specify a system-generated SubscriptionId field.

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

If you update a field type modifier, updating the application re-creates the subscription class to which it corresponds. Notification Services renames the existing subscription tables by appending "Old" to the table name and then creates new tables. Existing subscription table indexes are left unchanged.

If you want to transfer data between the old and new subscription tables, it must be done manually. For more information, see 更新應用程式.

範例

The following examples show how to define a subscription field that does not allow null values and then add it to the subscription schema:

// Define a DeviceName field that cannot be NULL
// Add the field to the end of the field collection
SubscriptionField subDevice = 
    new SubscriptionField(flightSubscriptions, "DeviceName");
subDevice.Type = "nvarchar(255)";
subDevice.TypeModifier = "not null";
flightSubscriptions.SubscriptionFields.Add(subDevice);
' Define a DeviceName field that cannot be NULL
' Add the field to the end of the field collection
Dim subDevice As SubscriptionField = _
    New SubscriptionField(flightSubscriptions, "DeviceName")
subDevice.Type = "nvarchar(255)"
subDevice.TypeModifier = "not null"
flightSubscriptions.SubscriptionFields.Add(subDevice)

執行緒安全性

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 的硬體和軟體需求>。

請參閱

參考

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

其他資源

定義訂閱結構描述