在触发器中如何获取以前的值 [英] in trigger how to take the previous values

查看:97
本文介绍了在触发器中如何获取以前的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临着一个问题,比如我的桌子就像是什么 数据库名称:DB2
ID名称价格日期

1芒果12 2/2/2012
2香蕉2012年1月31日
3水果100 2012年3月1日

如果我尝试更改当前表中必须发生触发器的内容(DML操作),并且在我的其他数据库中将其另存为WHERE,则我尝试更改价格列

数据库名称:DB3

ID价格日期

1 12 2/2/2012
2012年2月31日
3 100 3/1/2012

在此先感谢

I am facing a issue like if my table is like
DATABASE NAME:DB2
ID Name Price Date

1 mango 12 2/2/2012
2 banana 31 1/2/2012
3 fruit 100 3/1/2012

if i try to alter the content(DML OPERATION) of the current table where a trigger must occur and in my other database it should save as WHERE i am trying the alter the price column

DATABASE NAME:DB3

ID Price Date

1 12 2/2/2012
2 31 1/2/2012
3 100 3/1/2012

thanks in advance

推荐答案

您需要使用插入和删除的表.在使用已插入和已删除的表 [
You need to use inserted and deleted tables. Find out more about them at Using the inserted and deleted Tables[^].


这篇关于在触发器中如何获取以前的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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