共用方式為


SqlStatement Element for EventClass/Chronicles/Chronicle/SqlSchema (ADF)

Contains a Transact-SQL statement for an event chronicle table.

語法

<EventClasses>
    <EventClass>
        ...
        <Chronicles>
            <Chronicle>
                    ...
                    <SqlSchema>
                        <SqlStatement>

Element Characteristics

Characteristic Description

Data type

string, between 0 and 100,000 characters in length.

Default value

None.

Occurrence

Optional once or more per SqlSchema element.

Updates

Can be added, deleted, and modified when updating the application.

Element Relationships

Relationship Elements

Parent element

SqlSchema Element for EventClass/Chronicles/Chronicle (ADF)

Child elements

None.

備註

Use Transact-SQL statements to create the event chronicle table used to store supplemental event data.

When using a chronicle you should include one SqlStatement element that drops or renames the chronicle table if it already exists and one SqlStatement element that re-creates the chronicle table. If you do not drop or rename an existing chronicle table, you will receive an "object exists" error when you update the application. For an example, see SqlSchema Element for EventClass/Chronicles/Chronicle (ADF).

You may also want to have SqlStatement elements for indexes.

範例

The following example shows a SqlStatement element that drops the event chronicle table StockEventChron if it exists.

<SqlStatement>
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_NAME = 'StockEventsChron'
        AND TABLE_SCHEMA = 'dbo')
    DROP TABLE dbo.StockEventsChron;
</SqlStatement>

請參閱

參考

Application Definition File Reference

其他資源

定義事件紀事輯資料表
更新執行個體及應用程式

說明及資訊

取得 SQL Server 2005 協助