1
ALTER TRIGGER tr_EMPLOYEE2_FORINSERT
ON EMPLOYEE2
FOR INSERT
AS
BEGIN
-- SELECT * FROM INSERTED --INSERTED Table is a special table created for the purposes of Triggers, it is available only in the context of the trigger.
DECLARE @ID INT
SELECT @ID = ID FROM INSERTED
INSERT INTO EMPAUDIT
VALUES('New Employee with id = ' + cast(@id as nvarchar(5)) + ' is added at ' + cast(getdate() as nvarchar(20)))
END