SQL单元明智的触发器 [英] SQL cell wise trigger

查看:108
本文介绍了SQL单元明智的触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建特定的智能单元触发器?

Can a specific cell wise trigger be created?

或者是

IF UPDATE(COLUMN) WHERE OTHER_COLUMN LIKE 'JT'

SQL Server 2008中存在的等效项吗?

the equivalent present in SQL Server 2008?

EDIT

IF not UPDATE(CurrentNo) --// Wanted to do like this : where series ='JT'
    return

IF not EXISTS(SELECT 'True'
              FROM Inserted i
              JOIN Deleted d ON i.Series = d.Series
              WHERE i.Series = 'JT' AND d.Series = 'JT')
    return

似乎还可以!请发表评论.

Seems ok right! Please comment.

推荐答案

否.没有办法声明性地执行此操作.您将需要创建一个常规的Update触发器,并在其中添加逻辑以立即返回IF NOT UPDATE (column)

No. There is no way of doing this declaratively. You would need to create a general Update trigger and put logic in it to return immediately IF NOT UPDATE (column)

如果感兴趣的列 已更新,则您将查询inserteddeleted伪表,以允许您处理满足感兴趣条件的行.

If the column of interest was updated then you would query the inserted and deleted pseudo tables to allow you to process rows where your condition of interest was met.

这篇关于SQL单元明智的触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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