Database Triggers in SQL Server:-
- A database trigger is also a ‘named block’ like procedures executed implicitly.
Procedures in SQL Server :
- Called explicitly
- Procedure can be created without a table.
- Procedure accepts ‘parameters’.
- procedure returns a value.
Triggers in SQL Server:
- Called implicitly.
- Trigger can’t be created without a table.
- Trigger won’t accept parameters.
- Trigger won’t return a value.
Triggers are mainly created for:
- To implement complex business rules & validations.
- To do auditing.
- To provide security.
Business rules are Two Types:
Declarative : Integrity constraints.
Procedural: Database triggers.
Trigger Types in SQL Server :-
It can be divided into two types :