sql-serverindexed-view

Is there a way to find out which records have changed in an indexed view?


I have a table (invoice details) which has two columns (productid and quantity). I created an indexed view on this table in order to know the balance of products.

When a user enters an invoice on a computer, I want to refresh the product balance on another computer, so I need to know which rows in the indexed view were changed.


Solution

  • Transactional Replication allows you to replicate Indexed Views as Tables. This will track changes to the indexed view and apply them to the subscribers, who have a copy of the indexed view data as a table in the subscriber database.