Adding a publication v7
Subordinate to a publication database definition, you create publications that contain tables and views of the database identified in the publication database definition.
Step 1: Select the Publication Database node. Then select Publication > Create Publication.
Step 2: In the Create Publication dialog box, on the Create Publication tab, fill in the following fields:
- Publication Name. Enter a name that is unique among all publications.
- Snapshot-Only Replication. Select this box to perform replication by snapshot only. Tables included in a snapshot-only publication don't require identity columns (primary key or unique columns). See Design considerations for details. Tables included in publications for synchronization replication must have identity columns.
- Publish. Select the boxes next to the tables to include in the publication. If you select Snapshot-Only Replication, then views appear in the Publish list as well.
- Select All. Select this option if you want to include all tables and views in the Available Tables list in the publication.
- Use Wildcard Selection. Select this option to use the wildcard selector to choose tables for the publication. See Selecting tables with the wildcard selector for more information.
Step 3 (Optional): Table filters consist of a set of filter rules that control the selection criteria for rows replicated to the subscription tables during a snapshot or a synchronization replication. See Table settings and restrictions for table filters for table setup requirements for a log-based replication system as well as general restrictions on the use of table filters.
A filter rule consists of a filter name and a
SQL WHERE clause (omitting the WHERE keyword) called the filter clause, which you specify for a table or view that defines the selection criteria for rows include during a replication.
You can define multiple filter rules for each table or view in the publication. If you don't define a filter rule for a given table or view, then you can't later enable filtering on a corresponding subscription table associated with that publication table.
After filter rules are defined for a publication table or view, you can later choose whether to enable those filter rules on any subscription that you associate with that publication in accordance with the following rules.
- You can enable at most one filter rule on a given table in a given subscription.
- You can enable the same filter rule on the same given table in several, different subscriptions.
- You can enable different filter rules n the same given table but in different subscriptions.
If you want to define table filters on the publication tables or views, select the Table Filters tab. From the Table/View list, select the table or view for which you want to add a filter rule. Select Add Filter.
In the Filter dialog box, enter a descriptive filter name and the filter clause to select the rows you want to replicate. The filter name and filter clause must meet the following conditions:
- For any given table or view, each filter rule must be assigned a unique filter name.
- For any given table or view, the filter clauses must have different syntaxes (that is, the filtering criteria must be different).
Repeating this process, you can add filter rules for the EMP table.
To remove a filter rule, select the filter rule you want to remove and then select Remove Filter.
You can also modify the filter name or filter clause of a filter rule listed in the Table Filters tab. Double-click the cell of the filter name or filter clause you want to change. Enter the text for the desired change.
When creating a subscription, you can selectively enable these table filters on the corresponding subscription tables. See Adding a subscription for information on creating a subscription.
Step 4: Select Create. When Publication Created Successfully appears, select OK.
A Publication node is added to the replication tree.