Compartir a través de


SubscriptionField.TypeModifier Property

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

Espacio de nombres: Microsoft.SqlServer.Management.Nmo
Ensamblado: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintaxis

'Declaración
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)

Valor de propiedad

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

Notas

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 Actualizar una aplicación.

Ejemplo

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)

Seguridad para subprocesos

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.

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

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

Otros recursos

Definir el esquema de suscripción