something about trigger
To create a DML trigger requires ALTER permission on the table or view on which the trigger is being created.
permission in the current database.
A trigger will execute under the security context which invoke the trigger.
For example
Say I create a trigger on table1 for insert operation, userA execute insert row to table directorly.
The trigger would execute under userA's context.
If userA insert row through a procedure, the trigger would execute under the procedure's context instead of the
user's context.
If the operation in trigger fail, the whole transaction would roll back
To create a DDL trigger with server scope (ON ALL SERVER) or a logon trigger requires CONTROL SERVER permission on
the server. To create a DDL trigger with database scope (ON DATABASE) requires ALTER ANY DATABASE DDL TRIGGERpermission in the current database.
A trigger will execute under the security context which invoke the trigger.
For example
Say I create a trigger on table1 for insert operation, userA execute insert row to table directorly.
The trigger would execute under userA's context.
If userA insert row through a procedure, the trigger would execute under the procedure's context instead of the
user's context.
If the operation in trigger fail, the whole transaction would roll back