首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

sqlserver触发器:text,ntext,image类型不能在deleted,inserted表解决方法

2012-03-11 
sqlserver触发器:text,ntext,image类型不能在deleted,inserted表我想建立一个触发器在删除表A中的资料时,

sqlserver触发器:text,ntext,image类型不能在deleted,inserted表
我想建立一个触发器在删除表A中的资料时,把删除的资料放入到表B中
但是在建立时提示错误:
不能在 'inserted' 表和 'deleted' 表中使用 text、ntext 或 image 列。

表A中image类型的字段。
想吧表A中的字段都保留下来,有什么方法可以解决。
如果不能用触发器,还有其它的方法使用吗?


[解决办法]

SQL code
create tr trger on 表A instead of deleteasbegin  insert into 表B(A,B,C,D) select A,B,C,D from deleted  delete from 表A where A in(select A from deleted)end 

热点排行