I have a Users table and a Totals table which has an integer field for the total number of users. I thought about writing a console app that counts the Users table and then updates the 开发者_如何学CTotals table. And then make a Task scheduler events that executes this app every 10 minutes. Is there a more elegant way to do this?
Make the Totals table a view, so it doesn't need to be updated at all?
or ...
Update the Totals table with ON INSERT triggers on the Users table?
精彩评论