--CREATE TABLE Employee_Test
--(
--emp_ID INT Identity PRIMARY KEY,
--emp_Name Varchar(100),
--emp_Sal Decimal (10,2)
--)

--INSERT INTO Employee_Test VALUES ('Anees',1000);
--INSERT INTO Employee_Test VALUES ('Rick',1200);
--INSERT INTO Employee_Test VALUES ('John',1100);
--INSERT INTO Employee_Test VALUES ('Stephen',1300);
--INSERT INTO Employee_Test VALUES ('Maria',1400);

--SELECT *
--FROM Employee_Test

--CREATE TABLE Employee_Test_Audit
--(
--emp_AuditKey INT Identity PRIMARY KEY,
--emp_ID int,
--emp_name varchar(100),
--emp_Sal decimal (10,2),
--audit_Action varchar(100),
--audit_Timestamp datetime
--)

--SELECT *
--FROM Employee_Test_Audit

--CREATE TRIGGER trgAfterInsert ON [dbo].[Employee_Test] 
--FOR INSERT
--AS
--	DECLARE @empid int;
--	DECLARE @empname varchar(100);
--	DECLARE @empsal decimal(10,2);
--	DECLARE @audit_action varchar(100);

--	SELECT @empid=i.Emp_ID FROM inserted i;	
--	SELECT @empname=i.Emp_Name FROM inserted i;	
--	SELECT @empsal=i.Emp_Sal from inserted i;	
--	SET @audit_action='Inserted Record -- After Insert Trigger.';

--	INSERT INTO Employee_Test_Audit
--           (emp_ID, emp_Name, emp_Sal, audit_Action, audit_Timestamp) 
--	VALUES (@empid, @empname, @empsal, @audit_action, getdate());

--	PRINT 'AFTER INSERT trigger fired.'
--GO

--INSERT INTO Employee_Test 
--VALUES('Miles',2250);

--SELECT *
--FROM Employee_Test

--SELECT *
--FROM Employee_Test_Audit