Defined:
CREATE TRIGGER Trigger_name on table_name
With Encryption | EXECUTE AS [...]
After | Instead of
Insert | Delete | Update
As
#000000
#000000
---------
Manipulate the data through the inserted table deleted table.
--------------------------------------------------------------------------------------------------------------- ------------------------------------
CREATE TABLE T1 (X int, Y int);
CREATE TABLE T2 (X int, Y int);
Go
Create Trigger Tri_for_t1
On T1
After insert
As
INSERT into T2 (x, y) Select X, Y from deleted;
Go
--------------------------------------------------------------------------------------------------------------- -------------------------
Attention:
If the trigger is rollback, the transaction that causes the trigger is also rolled back. (indicates that they are in the same transaction, whether after or inserted of)
SQL Server triggers