|
Posted by Martijn Tonies on 08/06/05 16:35
> On the other hand, far from everthing can be handled in constraints, so
> triggers are more general.
>
>
> So are there cases when triggers beats constraints? Yes. Say that you
> have an CustomerCategories table that has an IsActive flag. An active
> customer must belong to a customer category which also is active. This
> can be implemented with a constraint, if you use a UDF to check the
> status of the customer category. Luckily, most people wouldn't think
> of this, and use a trigger instead. I played with this on a table with
> 30000 rows. An update of all rows went from one second to thirty...
Flags are bad :-)
--
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Navigation:
[Reply to this message]
|