0

SQL Server Transactional Replication:

I understand that T-Rep supports both row and column filters and this can be done through the GUI while setting up replication.

I am trying to create SQL code which can list down all the filters (row and column) for all the tables which replicate from publisher. This must be possible by querying the publisher DB.

Any help will be highly appreciated

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Alok Singh
  • 174
  • 3
  • 15

1 Answers1

1

For row filters you can query sysarticles which contains a row for each article defined. This table is stored in the publication database and contains 2 columns, filter and filter_clause which can help you identify row filters.

For column filters you can query sysarticlecolumns which contains one row for each table column that is published and maps each column to its article. This table is stored in the publication database.

Brandon Williams
  • 3,695
  • 16
  • 19
  • Just tried it and sysarticles does give me the row filters but I am unable to figure out how sysarticlecolumns should give me column filters. It has 5 columns but none of them talk about replication. Any help? – Alok Singh Jul 26 '16 at 17:23
  • Kendal provides a good script that shows how to tie sysarticlecolumns together here: http://www.kendalvandyke.com/2013/01/transactional-replication-toolbox.html – Brandon Williams Jul 26 '16 at 17:34
  • Remember that column filters are simply which columns are to be included/excluded in replication. – Brandon Williams Jul 26 '16 at 17:34