如何在插入后使用触发器更新空列?
问题描述:
如何在插入后使用触发器更新空列?
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[^]