Thursday, January 29, 2009

SQL Server triggers used to prevent users to modify data

IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[InterzicereModificari]'))
DROP TRIGGER [InterzicereModificari]
GO


CREATE TRIGGER dbo.DenyWrite_ViramenteAntet
ON [dbo].[Viramente - antet]
AFTER INSERT,DELETE,UPDATE
AS
BEGIN
RAISERROR ('Nu mai aveti dreptul de a modifica din acest program', 16, 1);
END
GO

No comments: