日期:2014-05-17 浏览次数:20420 次
create trigger goodMan
on t_good
for insert,delete,update
as
declare @gid int
declare @gname nvarchar(50)
declare @gmancount int
select @gid=gid,@gname=gname,@gmancount=gcount from inserted where gid is not null
begin
if exists(select gid from inserted) and not exists(select gid from deleted)
begin
insert into t_goodiolog (gid,gname,gmancount,gmankind,gdate)
SELECT @gid,@gname,@gmancount,'insert',GETDATE()
FROM deleted
end
end
create trigger goodMan
on t_good
for insert,delete,update
as
declare @gid int
declare @gname nvarchar(50)
declare @gmancount int
--select @gid=gid,@gname=gname,@gmancount=gcount from inserted where gid is not null
begin
if exists(select gid from inserted) and not exists(select gid from deleted)
begin
insert into t_goodiolog (gid,gname,gmancount,gmankind,gdate)
select gid,gname,gcount,'insert',GETDATE() from inserted where gid is not null
end
end