日期:2014-05-17 浏览次数:20525 次
CREATE trigger [dbo].[t_gpcr_bjd] on [syf].[dbo].[gpcr_bjd] for update as declare @id int BEGIN IF NOT UPDATE(isexsit) select @id =id from inserted BEGIN update [syf].[dbo].[gpcr_bjd] set isexsit = 1 where id = @id END END
CREATE trigger [dbo].[t_gpcr_bjd] on [syf].[dbo].[gpcr_bjd] for update as declare @id int BEGIN IF NOT UPDATE(isexsit) BEGIN update [syf].[dbo].[gpcr_bjd] set isexsit = 1 where id in (select id from inserted) END END
------解决方案--------------------
CREATE TRIGGER [dbo].[t_gpcr_bjd] ON [syf].[dbo].[gpcr_bjd] FOR UPDATE AS BEGIN IF NOT UPDATE(isexsit) BEGIN UPDATE a SET a.isexsit = 1 FROM [syf].[dbo].[gpcr_bjd] AS a,INSERTED AS i WHERE a.id = i.id END END
------解决方案--------------------
CREATE trigger [dbo].[t_gpcr_bjd] on [syf].[dbo].[gpcr_bjd] for update
as
BEGIN
IF NOT UPDATE(isexsit)
BEGIN
update a set isexsit = 1
from [syf].[dbo].[gpcr_bjd] a, inserted b where a.id=b.id
END
END