Answer Posted / sandeep
Triggers are also a stored procedure but it has some limits
and advantages over stored procedure.
first of all its limits. It cant accept or return values by
parameters whereas stored procedures do. It is called by
database server not by application or user.
It is generally treated as a constraint. It also make sure
the integrity of the data. We cud implement business rules
successfully by using triggers without writting a single
code in application. This is the main benifit of this
object we can change the business rule very easly from
database server when the actual business rules change that
means we dont want to edit and recompile the program soruce
code.
It will make problems in import process unless we switch
off the triggers.
There are 3 types of triggers in connection with insert,
update and delete statements
1. Before trigger
2. After Trigger
3. Instead of trigger
1. Before trigger fires before the manipulation of the data
happens by insert, update and delete statements. By using
this we cud do pre proces. ie updating other tables, pre
process of data, ..etc. After this actual manipulation
happens.
2. After triggers fires after the manipulation of the data
happens by insert, update and delete statements
3. Instead-of trigger. This trigger replaces the actual
manipulation statements. That means actual manipulation
statement wont work instead of this trigger will do the
manipulation work (statements in the trigger) by accepting
values from statement.
| Is This Answer Correct ? | 22 Yes | 2 No |
Post New Answer View All Answers
How you can move data or databases between servers and databases in sql server?
how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?
Do you know what is difference between index seek vs. Index scan?
How to run queries with sql server management studio express?
What is the stuff?
What are commit and rollback in sql?
When does the auto update index statistics feature in sql server turn itself on?q) what specific conditions database should meet, before you can bulk copy data into it using bcp?
Does group by or order by come first?
You want to implement the one-to-many relationship while designing tables. How would you do it?
What is an indexing strategy?
Can we hide the definition of a stored procedure from a use?
Tell me what is log shipping?
What stored by the model? : sql server database administration
what is the system function to get the current user's user id? : Sql server database administration
How to delete a database in ms sql server?