在创建触发器时出现不能在 'inserted' 表和 'deleted' 表中使用 text、ntext 或 image 列

1、
不能在 'inserted' 表和 'deleted' 表中使用 text、ntext 或 image 列


create trigger trg on t1 for update

改成

 

 

create trigger trg on t1 instead of update

将for改成 instead of 就可以在触发器中访问二进制字段了,也不需要去根据id去查询

 

 

2、

不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符

当你想对inserted及deleted两个表进行对比时可能会出现以上错误

 

posted @ 2012-06-30 14:45  Sam Lin  阅读(4056)  评论(0编辑  收藏  举报