sql server 2008 - Can I use a Trigger in this scenario? -


I have a table (i.e. report data) which includes some calculation data -> example class average score, number of students , Average grade points, etc. etc. I work great.

Now, if I change some data in some of my other tables (like classrooms table), then I need to update the report data table.

So I thought that if I insert, update, or delete a classroom table, then I can run my stored process which updates the data table, data.

So I thought a trigger would be good for this but I'm not sure. Why? Well, stored procedures that are used to perform all custom maths, will actually ask the class rhom table often. So will it use the most recent (eg converted) data?

e.g. If I change the field number number from 4-> 5. The stored procedure (which will check the field on the classroom table, can get 4 or 5 as data?

thanks :)

Note: Class discussion, etc. are just fake for the purpose of this discussion.

The rule of transaction is that you always change itself data can see.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -