Trigger - to evaluate ANY change to ANY field in the database
I'm looking at creating a trigger to evaluate ANY change in ANY varchar/nvarchar field in the database. If the new value (from the inserted record) contains certain text, it will either do a rollback or send an email to the SQL Administrator. So ... shy of writing individual table triggers (yes, for each of the 100+ tables in my database), is there a database level trigger that can detect that change to a given field? TIA for any thoughts or viable solutions ... Bob
No, there's not a universal INSTEAD OF trigger. If you're looking for something to cover the entire database in this fashion, you'd be better off writing it in the front-end. Otherwise, you'll have to write it for each table. What text or value is going to be universal across the entire database such that you can't let it be written anywhere, ever?