Using the new Triggers

The triggers have been rewritten and can now be used both in DW and OLTP environments. In order to show how they are used we made a very simple example showing some inserts, updates, and deletes. Updates are translated to inserts by the triggers. Similar triggers will be available in Bitemporal Anchor Modeling once it is finished, where also the deletes will result in inserts, instead of being actual deletes.

Note that the code above works with our standard example model. Just generate the SQL code from the example model in the tool (version 0.94 if you want the delete trigger) and run it in SQL Server and you will be able to test the code above. Using the triggers is optional and meant to be a way to simplify the way you use an anchor database. You can always use inserts directly to get the same behavior.

Published by

Lars Rönnbäck

Co-developer of the Anchor Modeling technique. Programmer of the online modeling tool. Site maintainer. Presenter and trainer.

Leave a Reply

Your email address will not be published. Required fields are marked *