关于insert,update的临时表 create trigger GrUpdate
on [dbo].[SC]
after insert,update
as
declare @befGr smallint,@afrGr smallint
if UPDATE(Grade)
begin
select @befGr=DELETED.Grate from DELETED
select @afrGr=INSERTED.Grate from INSERTED
INSERT INTO [JXGL].[dbo].[Gradechange]
([usename]
,[changetime]
,[bfch_value]
,[afch_value])
VALUES
(USER_NAME()
,GETDATE()
,@befGr
,@afrGr)
end
报错:
Msg 207, Level 16, State 1, Procedure GrUpdate, Line 8
Invalid column name 'Grate'.
Msg 207, Level 16, State 1, Procedure GrUpdate, Line 9
Invalid column name 'Grate'.
求大神帮忙
create trigger GrUpdate
on [dbo].[SC]
after insert,update
as
declare @befGr smallint,@afrGr smallint
if UPDATE(Grade)
begin
select @befGr=DELETED.Grade from DELETED
select @afrGr=INSERTED.Grade from INSERTED
INSERT INTO [JXGL].[dbo].[Gradechange]
([usename]
,[changetime]
,[bfch_value]
,[afch_value])
VALUES
(USER_NAME()
,GETDATE()
,@befGr
,@afrGr)
end
create trigger GrUpdate
on [dbo].[SC]
after insert,update
as
--declare @befGr smallint,@afrGr smallint
if UPDATE(Grade)
begin
--select @befGr=DELETED.Grade from DELETED
--select @afrGr=INSERTED.Grade from&nbs