Примечание.
Для доступа к этой странице требуется авторизация. Вы можете попробовать войти или изменить каталоги.
Для доступа к этой странице требуется авторизация. Вы можете попробовать изменить каталоги.
Initializes a new instance of the SubscriptionField class with a SubscriptionClass object and a name.
Пространство имен: Microsoft.SqlServer.Management.Nmo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
Синтаксис
'Декларация
Public Sub New ( _
subscriptionClass As SubscriptionClass, _
name As String _
)
public SubscriptionField (
SubscriptionClass subscriptionClass,
string name
)
public:
SubscriptionField (
SubscriptionClass^ subscriptionClass,
String^ name
)
public SubscriptionField (
SubscriptionClass subscriptionClass,
String name
)
public function SubscriptionField (
subscriptionClass : SubscriptionClass,
name : String
)
Параметры
- subscriptionClass
The parent SubscriptionClass object for the subscription field.
name
A String, between 1 and 128 characters in length, that specifies the name of the subscription field.You cannot change the name. To rename a subscription field, remove the field and then add a new subscription field that has the new name.
Замечания
You must set the Type property. Setting the TypeModifier property is optional.
Field names must start with a letter or underscore character and can contain letters, numbers, and the characters _, #, @ and $. They must also conform to Microsoft SQL Server identifier conventions. For more information about SQL Server identifiers, see Идентификаторы.
Важно! |
|---|
| You cannot name a subscription field Created, Enabled, SubscriberId, SubscriptionId, or Updated. Microsoft SQL Server 2005 Notification Services already uses these field names internally. |
If you update the name, 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 and add it to the subscription schema:
// Define a SubscriberLocale field that cannot be NULL
// Add the field to the end of the field collection
SubscriptionField subLocale =
new SubscriptionField(flightSubscriptions, "SubscriberLocale");
subLocale.Type = "nvarchar(10)";
subLocale.TypeModifier = "not null";
flightSubscriptions.SubscriptionFields.Add(subLocale);
' Define a SubscriberLocale field that cannot be NULL
' Add the field to the end of the field collection
Dim subLocale As SubscriptionField = _
New SubscriptionField(flightSubscriptions, _
"SubscriberLocale")
subLocale.Type = "nvarchar(10)"
subLocale.TypeModifier = "not null"
flightSubscriptions.SubscriptionFields.Add(subLocale)
Платформы
Платформы разработки
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
Целевые платформы
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
См. также
Справочник
SubscriptionField Class
SubscriptionField Members
Microsoft.SqlServer.Management.Nmo Namespace
Другие ресурсы
Определение схемы подписок
FieldName Element for SubscriptionClass/Schema/Field (ADF)
Важно!