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
What do you understand by recursive stored procedure?
How to create an multi-statement table-valued function?
Is truncate autocommit?
Explain the use of containers in ssis?
Can we use where and having clause together?
What is mean by dml?
Name and describe few console utilities for ssrs?
What is the difference between dbcc indexdefrag and dbcc reindex?
Characterize join and name diverse sorts of joins?
What is the purpose of indexing?
Can we use having clause without group by?
What is the purpose of a table?
Write a query to include a constraint, to check whether the employee salary is greater than 5000?
Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you
Introduction of rollup clause using sum and group by clause?