简体   繁体   中英

SQL server database design question

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 Totals 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM