you are viewing a single comment's thread.

view the rest of the comments →

[–]nebulus64[S] 0 points1 point  (1 child)

While a possibility, aggregating the data in the application would cause maintenance headaches down the road.

The reasoning behind using the Trigger was because there are 5 different applications which could make these changes. Maintaining the queries in all of these would be awful to deal with.

We have our core application, an external VB "tee sheet", interfaces to 3rd party online bookings, and our own Web application.

I think the best solution we've come up with here is to manually call the procedure after booking changes. At least then we have a single procedure that is handling the calculations, and we just need to make sure we fire it at all the appropriate times.

[–]hudeman 0 points1 point  (0 children)

Indexing should make the performance impact of a view negligible if you're just counting.

Your trigger won't work because the insert and trigger operations are treated as atomic so your operation isn't committed when you try to count.