无法在“已插入”和“已删除”表中使用text,ntext或image列 [英] Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables

查看:224
本文介绍了无法在“已插入”和“已删除”表中使用text,ntext或image列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个错误无法在'insertted'和'deleted'表中使用text,ntext或image列,因为原始表中有ntext字段,所以我已经将触发器附加到了。

I got an error "Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables", since there are ntext fields in original table, I had attached a trigger to.

这是一个解决方案: http://lazycodeprogrammer.blogspot.com/2009/08/how-to-use-inserteddeleted-with.html

但原始(非修改)查询就足够复杂了。推荐使用JOIN运算符代替SELECT * FROM INSERTED来写什么?

But original (non modified) query is complex enough. What should I write instead of SELECT * FROM INSERTED, using JOIN operator, as it's recommended?

推荐答案

已找到一个不错的解决方案:

A nice solution has been found:


  1. 仅从插入的id列(不是ntext或图像,正在执行查询)。

  2. 从具有相同ID的原始表*中进行选择。

  3. 如果需要,请在INSERTED上使用UPDATED()来知道哪些列已更改。

这篇关于无法在“已插入”和“已删除”表中使用text,ntext或image列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆