You are here: Re: Triiger -vs- Constraint « MsSQL Server « IT news, forums, messages
Re: Triiger -vs- Constraint

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация