About Lesson
SELECT TOP (1000) [Id]
,[LogData]
FROM [sircldb].[dbo].[tblEmpLog]
select * from tblemp;
CREATE TRIGGER tr_tblemp_delete
ON tblEmp FOR DELETE
AS
BEGIN
Declare @Id int;
declare @data nvarchar(500);
Select @Id = ENo from deleted
set @data=’An existing employee with Id = ‘ + Cast(@Id as nvarchar(5)) + ‘ is deleted at ‘ + Cast(Getdate() as nvarchar(20));
insert into tblEmpLog
values(@data)
END
select * from tblEmpLog;
delete from tblemp where eno=1007;
select * from tblEmpLog;
create trigger tr_tblemp_update
on tblemp for update
as
begin
Select * from deleted
Select * from inserted
end
select * from tblemp;
update tblemp set RecordStatus=’I’ where dno=10;