plee
plee

Reputation: 11

Detecting changes to a SQL view

I have several underlying data tables and some SQL views that apply business logic to those tables. I have a process that at every 5min interval will check the view to see if anything has changed from the last 5min check. I was wondering the best way to implement this step. Initial thoughts is using a check_sum/hashbytes on the view and then if not equal, doing some type of row by row comparison on primary keys but that doesn't seem too efficient. Is there a better way to identify which rows have been changed (or deleted) in the view?

I want to shy away from using triggers on the underlying tables due to some business requirements. Any thoughts?

Upvotes: 0

Views: 1798

Answers (1)

Greg Low
Greg Low

Reputation: 1586

The closest you will get to what you want is Query Notifications < https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/query-notifications-in-sql-server >

Upvotes: 1

Related Questions