如何在插入后使用触发器更新空列? [英] How to update a null column using trigger after insert?

查看:70
本文介绍了如何在插入后使用触发器更新空列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在插入后使用触发器更新空列?

How to update a null column using trigger after insert?

推荐答案

这样的事情可以帮助你入门:



Something like this should help get you started:

CREATE TRIGGER trig_InsertExample
ON [TestTable]
FOR INSERT
AS
Begin
    Insert into TestTable (Col1, Col2) 
    Select t.SomeOtherValue, null 
    from Inserted i
    Left Join TestTable t
    on i.ID = t.ID;
End


检查此链接。



http ://msdn.microsoft.com/en-in/library/ms189799(v = sql.100).aspx [ ^ ]
Check this link.

http://msdn.microsoft.com/en-in/library/ms189799(v=sql.100).aspx[^]


这篇关于如何在插入后使用触发器更新空列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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