我正在创建一个触发器,在某个列的插入或更新期间执行某些功能。我知道下面的内容适用于更新,但它是否适用于插入?
IF UPDATE (MobilePhone)
BEGIN
SELECT @TeamId = TeamId FROM Inserted
END
答案 0 :(得分:1)
您可以从MSDN文档中看到。
http://technet.microsoft.com/en-us/library/ms187326.aspx
Is the name of the column to test for either an INSERT or UPDATE action. Because the table name is specified in the ON clause of the trigger, do not include the table name before the column name. The column can be of any data type supported by SQL Server. However, computed columns cannot be used in this context.