Поделиться через


Chronicles Element for SubscriptionClass (ADF)

Provides a location for defining one or more Transact-SQL statements that determine the table structure for the chronicle tables used by the subscription class.

Синтаксис

<SubscriptionClasses>
    <SubscriptionClass>
        ...
        <Chronicles>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Optional once per SubscriptionClass element.

Updates

Can be added and deleted when updating an application.

Element Relationships

Relationship Elements

Parent element

SubscriptionClass Element (ADF)

Child elements

Chronicle Element for SubscriptionClass/Chronicles (ADF)

Замечания

If you update the ChronicleName value, updating the application re-creates the subscription class to which it corresponds. Microsoft SQL Server 2005 Notification Services renames existing subscription tables by appending "Old" to the name and then creates new subscription tables. Existing subscription table indexes remain unchanged.

If you want to copy data between the old and new subscription tables, you must do so after updating the application. For more information, see Обновление приложения.

Пример

The following example shows a Chronicles element that deletes any existing table named StockSubsriptionChron and then creates a StockSubscriptionChron subscription chronicle table. This table consists of the SubscriberID, StockSymbol, and StockPrice fields.

<Chronicles>
    <Chronicle>
        <ChronicleName>StockSubscriptionChron</ChronicleName>
        <SqlSchema>
            <SqlStatement>
            -- Delete any existing table with the same name.
            IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
            WHERE TABLE_NAME = &apos;StockSubscriptionChron&apos;)
            DROP TABLE StockSubscriptionChron
            </SqlStatement>
            <SqlStatement>
            -- Create subscription chronicle
            CREATE TABLE StockSubscriptionChron
            (
            SubscriberId bigint,
            StockSymbol char(10),
            StockPrice money
            PRIMARY KEY (SubscriberId)
            );
            </SqlStatement>
        </SqlSchema>
    </Chronicle>
</Chronicles>

См. также

Справочник

Application Definition File Reference

Другие ресурсы

Определение хроники для класса подписки
Обновление экземпляров и приложений

Справка и поддержка

Получение помощи по SQL Server 2005