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.
Syntax
<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 |
|
Child elements |
Remarks
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 Updating an Application.
Example
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 = 'StockSubscriptionChron')
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>
See Also
Reference
Application Definition File Reference
Other Resources
Defining Chronicles for a Subscription Class
Updating Instances and Applications