Hi folks,
I have a table (ie. ReportData) which contains some calculated data -> eg. classroom average scores, number of students, avg grade point, etc. etc. lots of report like data. Works great.
Now, in some of my other tables (eg. the ClassRoom table) if i change some data in there, I need to update the ReportData table.
So I thought that if i do any INSERT, UPDATE or DELETE on the ClassRoom table, then i can run my stored procedure which updates the ReportData table, data.
SO i thought a trigger would be good for this. But, I'm not sure. Why? Well, the stored procedure which is used to do all the custom math will actually occasionaly query the ClassRoom table. So will it access the most recent (eg. Changed) data?
eg. If i change the field 'NumberOfStudents' from a 4 -> 5. Will the stored procedure (which will end up checking that field, on the ClassRoom table, retrieve a 4 or 5 as the data?
Thanks :)
NOTE: ClassRooms, etc are just fake for the purpose of this discussion.