sp_check_subset_filter (Transact-SQL)
Collapse the table of content
Expand the table of content

sp_check_subset_filter (Transact-SQL)

Is used to check a filter clause against any table to determine if the filter clause is valid for the table. This stored procedure returns information about the supplied filter, including if the filter qualifies for use with precomputed partitions. This stored procedure is executed at the Publisher on the database containing the publication.

Topic link icon Transact-SQL Syntax Conventions

sp_check_subset_filter [ @filtered_table = ] 'filtered_table'
        , [ @subset_filterclause = ] 'subset_filterclause'
    [ , [ @has_dynamic_filters = ] has_dynamic_filters OUTPUT ]

[ @filtered_table= ] 'filtered_table'

Is the name of a filtered table. filtered_table is nvarchar(400), with no default.

[ @subset_filterclause = ] 'subset_filterclause'

Is the filter clause being tested. subset_filterclause is nvarchar(1000), with no default.

[ @has_dynamic_filters= ] has_dynamic_filters

Is if the filter clause is a parameterized row filter. has_dynamic_filters is bit, with a default of NULL and is an output parameter. Returns a value of 1 when the filter clause is a parameterized row filter.

0 (success) or 1 (failure)

Column name Data type Description



Is if the publication qualifies for using precomputed partitions; where 1 means that precomputed partitions can be used, and 0 means that they cannot be used.



Is if the supplied filter clause includes at least one parameterized row filter; where 1 means that a parameterized row filter is used, and 0 means that such a function is not used.



List of the functions in the filter clause that dynamically filter an article, where each function is separated by a semi-colon.



If the HOST_NAME() function is used in the filter clause, where 1 means that this function is present.



If the SUSER_SNAME() function is used in the filter clause, where 1 means that this function is present.

sp_check_subset_filter is used in merge replication.

sp_check_subset_filter can be executed against any table even if the table is not published. This stored procedure can be used to verify a filter clause before defining a filtered article.

Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_check_subset_filter.

Community Additions

© 2015 Microsoft