Creates a filter stored procedure used to horizontally partition data replicated from a published table.
sp_articlefilter publication, article [, filter_name] [, filter_clause]
where
This stored procedure creates the filter and inserts the ID of the filter stored procedure in the filter column of the sysarticles table, and it inserts the text of the restriction clause in the filter_clause column.
Only unsubscribed articles can be modified by this stored procedure.
To create an article with a horizontal partition, execute sp_addarticle with no filter parameter. Execute sp_articlefilter, providing all parameters including filter_clause. Then execute sp_articleview, providing all parameters including the identical filter_clause. If the filter already exists and if the type in sysarticles is 1 (log-based article) or 3 (log-based article with manual filter), the filter will be dropped and re-created.
If filter_name and filter_clause are not provided, the previous filter is deleted and the filter ID is set to 0.
This example creates the mypub filtered stored procedure.
sp_articlefilter, MyPub, MyArticle, MyFilter, 'state = "OR"'
Only the system administrator and the database owner can use this stored procedure.
sysobjects, syspublications, syssubscriptions, sysarticles
sp_addarticle | sp_articleview |
sp_articlecolumn |