Share via


SubscriptionField.TypeModifier Property

Gets or sets the optional Microsoft SQL Server field attributes for the subscription 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 subscription 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 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 Updating an Application.

Example

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)

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

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

Other Resources

Defining the Subscription Schema