首页 > 解决方案 > 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?

标签: sqlsql-server

解决方案



推荐阅读