sqlserver添加数据的时候提示对象名‘update’无效

sqlserver添加数据的时候提示对象名‘updated’无效

原来自己在要修改的表中添加了一个触发器:

USE [XSCJ]

GO

/****** 对象: Trigger [dbo].[T1] 脚本日期: 04/10/2011 16:25:05 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER trigger [dbo].[T1] on [dbo].[COU] for insert,update as if(update(cno) and (exists (select cno from cou where cno = (select cno from updated))))

begin

print'11111'

end

而内存中只有存在deleted表和inserted表

如果要修改,先把要修改的记录放在deleted表里,然后再把修改后的记录放在inserted里才行。把这个触发器删除之后恢复正常。


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-12-01
  • 2022-12-23
  • 2021-08-31
  • 2022-01-07
  • 2021-08-02
  • 2022-12-23
相关资源
相似解决方案