Triggers in SQL
Triggers are special type of procedures which fire implicitly or automatically.There are 2 types Triggers available in sql.They are
1.DDL Triggers
2.DML Triggers
1.DDL Triggers
This trigger will fire while doing DDL operations.
(e.g)
create trigger Employee
on database
for
create_table,alter_table,drop_table
as
print'you can not create ,drop and alter table in this database'
rollback;
2.DML Triggers
This trigger will fire while doing DML operations.
(e.g)
create trigger deep
on tblemp
for
insert,update,delete
as
print'you can not insert,update and delete this table '
rollback;
1.DDL Triggers
2.DML Triggers
1.DDL Triggers
This trigger will fire while doing DDL operations.
(e.g)
create trigger Employee
on database
for
create_table,alter_table,drop_table
as
print'you can not create ,drop and alter table in this database'
rollback;
2.DML Triggers
This trigger will fire while doing DML operations.
(e.g)
create trigger deep
on tblemp
for
insert,update,delete
as
print'you can not insert,update and delete this table '
rollback;
Comments
Post a Comment