What is a Trigger in Database ? What is Stored Proedure ?
This Database Trigger question and Stored Procedure question is one of the most Frequently asked questions in Databases so make sure that you are good with it. No one will ask you in detail on this and answering well this problem will surely fetch you some advantage. Also be clear with there Difference too.
A trigger is a code that is Automatically and immediately executed when a certain event took place on a table in the database. They are pre built code and used to for logging purpose or to erstrict people from accessing some data.
A stored procedure is a group of SQL statements that form a logical unit and perform a particular task, and they are used to encapsulate a set of operations or queries to execute on a database server. One of the biggest advantages of using stored procedures over not using stored procedures is the ability to significantly reduce network traffic. And the more network traffic that can be reduced, the better the overall performance of your SQL Server-based applications.
How does Stored Procedure reduce the Network load ? Simple, everytime we don't have to go through network for every call to get ingormation or to perform certain operation on database. Do it all on one go.
