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
How to use subqueries in the from clause in ms sql server?
can an order by clause be used in a creation of a view?
What is microsoft sql server?
How can you append an identity column to a temporary table?
Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?
Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration
What are the key configuration files for sql server reporting services ?
Why would you call update statistics?
What is a field in a table?
Explain how to maintain a fill factor in existing indexes?
Can you roll back the ddl statement in a trigger?
In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram
What is the difference between char, varchar and nvarchar?
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?
What is 'Join' and explain its various types.