Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Triggers

Status
Not open for further replies.

revilord

Programmer
Oct 2, 2003
64
I have a table

col1 col2

one mandatory

two not mandatory

three not mandatory

four not mandatory

five mandatory



I am trying to write a trigger that will prevent uses from deleting or updating the mandatory records (rows 1 and 5). Something like

If you update or delete where col1 is one, five then rollback the transaction. I know this will hit me at 3 in the morning Sunday night but I would apprieciate some expertise here. Thanks
 
Since rules defined on data, I would store metadata on another table. So define another table, put a FK on this table and define the FK rules like cascade on delete etc.
HTH
 
>>I am trying to write a trigger that will prevent uses from deleting or updating the mandatory records (rows 1 and 5).

and that is not working???

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top