To track the changes in a view on daily basis [closed]
开发者_如何学Python
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this questionHow could I get the changes (data) in a view between a certain period of time. Changes like new rows, updated rows or deleted rows. I am making a stored proc which has to detect the changes in a huge view and then sync them with another table on daily basis. I dont want to to scan all rows when I know the changed rows will be less than 1% daily.
Thanks.
The view is going to change when the underlying data changes. You need to detect changes in the columns in the tables that are in the view - you will probably need triggers on that column that will fire a stored procedure that reconstructs the SELECT query the view is using, and then update the other table as necessary.
精彩评论