Difference between Triggers and Stored Procedure

Answer Posted / manoj kopardekar

STORED PROCEDURE
A stored procedure is an already written SQL statement that
is saved in the database. We can run the stored procedure
from the database's command environment

1.Precompiled execution. SQL Server compiles each stored
procedure once and then reutilizes the execution plan. This
results in tremendous performance boosts when stored
procedures are called repeatedly.
2.Reduced client/server traffic. If network bandwidth is a
concern in your environment, you'll be happy to learn that
stored procedures can reduce long SQL queries to a single
line that is transmitted over the wire.
3.Efficient reuse of code and programming abstraction.
Stored procedures can be used by multiple users and client
programs. If you utilize them in a planned manner, you'll
find the development cycle takes less time.
4.Enhanced security controls. You can grant users permission
to execute a stored procedure independently of underlying
table permissions.


TRIGGER

A trigger is an object contained within an SQL Server
database that is used to execute a batch of SQL code
whenever a specific event occurs. As the name suggests, a
trigger is “fired” whenever an INSERT, UPDATE, or DELETE SQL
command is executed against a specific table.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a user to access a database in ms sql server using "create user" statements?

726


What is BCNF? How is it better than 2NF & 3NF?

769


can a database be shrunk to 0 bytes, if not, why? : Sql server administration

808


Can we linked SharePoint to a SQL database?

749


Explain the concept of recursive stored procedure.

666






Can you roll back the ddl statement in a trigger?

702


What are information schema views?

740


What is executereader?

728


What is a livelock?

721


What is the purpose of data source?

712


How do I find the size of a sql server database?

654


What is a primary index?

699


What are partitioned views and distributed partitioned views?

803


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1789


How you can change the database name in SQL SERVER?

863