我正在创建一个触发器,该触发器在某个列的插入或更新期间执行某些功能。我知道以下内容适用于更新,但它也适用于插入吗?
IF UPDATE (MobilePhone)
BEGIN
SELECT @TeamId = TeamId FROM Inserted
END
我正在创建一个触发器,该触发器在某个列的插入或更新期间执行某些功能。我知道以下内容适用于更新,但它也适用于插入吗?
IF UPDATE (MobilePhone)
BEGIN
SELECT @TeamId = TeamId FROM Inserted
END
看起来你可以从 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.