Using a trigger to perform mass-update-safe, specific-field calculations
Επεσα επάνω σε ένα απλό SQL-related σενάριο τις προάλλες, αλλά σκέφτηκα, αν και δεν είναι το super-duper άρθρο, να το μοιραστώ μαζί σας.
UPDATE: Εγώ μπορεί να νομίζω ό,τι θέλω, αλλά στο www.sswug.org έγινε Featured Article. :)
Time-saver, σε περίπτωση που σας έχει τύχει κάτι παρόμοιο.
The scenario
You’ve got a table which contains some information and you want to perform calculations based on this information and store them in the same table or in another table.
The calculations must always be up-to-date.
The calculations are performed via a complex User Defined Function which accepts the other fields’ values as parameters.
The table has got thousands of rows and thus you do not want to use a view because it’ll degrade the overall performance.
For the same reason, you do not want to use a calculated field.
Διαβάστε περισσότερα εδώ, στα άρθρα.