enforcing integrity with sp & triggers | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

enforcing integrity with sp & triggers

I am wondering how can triggers and stored procedures are used to enforce the integrity constraint.Please expalin wih some examples
HI,<br />Triggers are most useful when the features supported by constraintss cann’t meet the functional needs of the application.<br />For example :<br /><br />Foreign Key = constraints do not support cascading activities and they can validate a column value only with an exact match to a value in another column if yr application requires that a delete from one table will also result in a delete of related data in another table or if the referential integrity requires something other than this, you must use trigger.<br /><br />Check = constraints can validate column value only against a logical expression or another column in the same table , if yr application requires that column value be validate against column in another table , u must use trigger.<br /><br />And constraints can communicate about errors only through standardized system messages if yr application requires (or benefit from) customized message and complex error handling u must use trigger.<br /><br />and further read following : <br /><b><a href=’http://www.sql-server-performance.com/trigger_tuning.asp’ target=’_blank’ title=’http://www.sql-server-performance.com/trigger_tuning.asp'<a target="_blank" href=http://www.sql-server-performance.com/trigger_tuning.asp>http://www.sql-server-performance.com/trigger_tuning.asp</a></a></b><br /><br /><br /><br />[<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />]<br />HTH<br />Regards.<br /><br />hsGoswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemant Goswami<br />
]]>