SQL SERVER 建立触发器,禁止更新,并且写入记录!
ALTERtrigger[tp_1]on[dbo].[Result]afterupdateasIF(UPDATE([KSCJ])orUPDATE([KFDM]))decl...
ALTER trigger [tp_1] on [dbo].[Result]
after update
as IF (UPDATE([KSCJ])or UPDATE([KFDM]))
declare @t_kscj varchar(500);
--declare pragma autonomous_transaction ;
select @t_kscj =kscj from Deleted;
begin
insert into usersetlog (infodetial,infotime)values('报警:准备更新考试'+ @t_kscj,getdate());
commit;
rollback;
end;
infodetial获得的数据为空,是连接符不对么? 展开
after update
as IF (UPDATE([KSCJ])or UPDATE([KFDM]))
declare @t_kscj varchar(500);
--declare pragma autonomous_transaction ;
select @t_kscj =kscj from Deleted;
begin
insert into usersetlog (infodetial,infotime)values('报警:准备更新考试'+ @t_kscj,getdate());
commit;
rollback;
end;
infodetial获得的数据为空,是连接符不对么? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询