ALTER TRIGGER dbo.Vigilancias_Trigger_Eventos
ON dbo.Vigilancias
AFTER INSERT, UPDATE, DELETE
AS
BEGIN
DECLARE @accion AS NVARCHAR(20);
SET @accion = 'Creación'
IF EXISTS(SELECT * FROM DELETED)
BEGIN
SET @accion =
CASE
WHEN EXISTS(SELECT * FROM INSERTED) THEN 'Modificación'
ELSE 'Eliminación'
END
END
END
No hay comentarios:
Publicar un comentario