Generate Filters Automatically

Replication Wizard Help

Replication Wizard Help

Generate Filters Automatically

To define a static filter in your table, identify a table in your database that contains at least one column of the characteristics on which to filter.

To define a dynamic filter, identify a table in your database that contains at least one column of hostnames and one column of a host characteristic on which to filter. For example, the following table has one column containing hostnames and one column containing the host's region.

Hostname Region
Smith 5
Smith 6
Jones 2
Green 1

The table is the starting point for a filter on hostnames that can be extended automatically to filter related tables. In this example, applying a filter to return only rows for Smith would result in Microsoft® SQL Server™ 2000 also including the rows for regions 5 and 6 in any related tables. If you do not have a suitable table in your database, you must create one.

For either static or dynamic filters, select from the list the table in your database that contains the column(s) of data used in the first filter. Then enter the conditions to be used in extending the first filter to another column(s) of data in the tables. Enter only the conditions to be used in the filter. Do not enter the entire SELECT statement, and do not enter the WHERE keyword. For example, enter only:

sales.rep = SUSER_SNAME()

instead of

WHERE sales.rep = SUSUER_SNAME()

After you complete this wizard page, SQL Server will generate a tentative list of JOIN filters to display in the next wizard dialog box.

See Also

Filtering Published Data