The “Include Tables” and “Exclude Tables” tabs of the Replication Object Wizard generate the object rules of a Capture Process: the tables which are replicated (DML), the tables whose DDL statements are replicated (DDL) and the tables whose existing data is copied before the replication starts (Initial Load). The rules are written to the six fields of the “Objects Rules” tab of the process form: “DML Include”, “DDL Include”, “Load Include”, “DML Exclude”, “DDL Exclude” and “Load Exclude” (see Capture Objects Specification). A table is replicated if its name matches an include rule and does not match an exclude rule.
The “Include Tables” tab opens first. “Replicated Tables” lists the tables which the rules of the process include now: “DML” and “DDL” show a + for the tables whose changes or DDL statements are replicated, “Load” shows L for the tables which are loaded first:
To look for other tables enter the schema and the table name and choose an operator for each of them: “Any” matches every name, “Like” the names which start with the text, “Contains” the names which contain the text and “=” only the name which is exactly the text. Do not type the % symbol, the wizard adds it for “Like” and “Contains”:
Click “Show results”:
The tables which meet the criteria are listed, 10 on a page (use the arrows under the list to see the other pages). The marks appear when the rules are generated. “Clear search results” removes the criteria and shows the tables of the current rules again:
The flags under the list define what is generated:
Every flag writes its own field: DML to “DML Include”, DDL to “DDL Include” and Initial Load to “Load Include”. At least one flag stays ticked. A table which is loaded must be replicated as well, so tick “DML” together with “Initial Load” (see Initial Load). Tick the tables to generate the rules for them only:
When “Initial Load” is ticked, choose in the list how the tables of the Target Database are prepared before the data is copied:
Click “Options” (the link is called “Edit” once the options are set) to open “Initial Load Options”:
Click “Save” to keep the options. They are added to every load rule which is generated by the next “Generate include rules”, so use a filter for one table (as in the picture) or for tables which all have the column. The syntax of the load rules is described in Initial Load.
Click “Generate include rules”. The rules are added at the end of the rules which are in the three fields (a rule is not added twice) and “Replicated Tables” shows the result: the table DimProduct is included in the DML and the DDL replication and is loaded first, the tables dbo.DimC% were included before:
These rules were generated in the pictures of this page:
The rules can also be typed in the fields, or edited one by one in the window which opens with the three dots (…) next to a field (see Edit Replication Processes):
After the Initial Load has been completed the Capture Process removes the load rules, so “Load Include” and “Load Exclude” are empty again (see Initial Load).
The “Exclude Tables” tab works in the same way (search, flags, “Generate exclude rules”) but has no load modes. The rules go to “DML Exclude”, “DDL Exclude” and “Load Exclude”. An exclude rule wins over an include rule: a table which matches both is not replicated. Search the table and click “Generate exclude rules”:
The list shows the effect: with “DML” ticked the table dbo.DimCustomer lost its “DML” mark, it is not replicated any more, while its DDL statements still are:
Click “Save Changes” when the rules of all the tabs are ready (see Replication Object Wizard for what happens next: the rules are stored with “Save Process”). For the transformation rules see Transformation (Mapping) Rules.
Prev page:
Replication Object WizardNext page:
Transformation (Mapping) Rules