November 2004 - Posts

what is better constraint or Trigger??
If it is a job of just referential integrity I would use a constraint, where as if more complex logic is to be performed, then trigger.
constraints are proactive - they prevent unwanted actions from happening.
Triggers are reactive - they rollback the damage.
While deleting a record from a table a constraint would tell not to delete a parent record if child records exist.
A trigger rolls back the delete operation if you try to delete a parent record having child records.
Constraints apply to underlying table.
Triggers can access multiple tables(even tables in other databases).
With a trigger you can generate more custom and understandable and user friendly error messages as compared to cryptic messages returned by the constraints.

These are a few points to compare.. more are welcome.

with 3 Comments

An Israeli hacker reveals: A security hole in Gmail allows the compromise of users' email boxes – without the need of a password.

Link

with 5 Comments

 All good programmers test their code. But can testing be easier? Can it be better? S. A. Miller shows how unit tests can help, along with an open source testing framework called TSQLUnit.

check the article here

with 3 Comments