Post by m***@gmail.comHi, please I would know if there's a way to prevent the deletion on all
tables using the triggers (for example) without exceptions.
I tried "transaction rollback" but it throws an error.
If you invent your syntax, that usually results in an error. A vile trigger
could look like this:
CREATE TRIGGER nono_tri ON tbl INSTEAD OF DELETE AS
RAISERROR ('Deletes on this table are not permitted!', 16, 1)
ROLLBACK TRANSACTION
RETURN
You need to put this on every table. There is no provision for a general
database trigger that applies to all tables.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx