ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
Wht is the difference between stored procedure and trigger
 Question Submitted By :: Mirjawad
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Wht is the difference between stored procedure and trigger
Answer
# 1
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 ?    6 Yes 0 No
Rajvelur
 
  Re: Wht is the difference between stored procedure and trigger
Answer
# 2
Stored Procedures does not execute automatically

Triggers are a special type of Stored procedure which
executes automatically

Types of Triggers
 - INSTEAD OF triggers
 - AFTER Triggers
 
Is This Answer Correct ?    2 Yes 1 No
Jerry Joseph
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
how to find number of columns in a table in sql server 2000 and 2005 also Virtusa6
When do you create cluster and noncluster index? Satyam4
What are constraints? Explain different types of constraints?  4
can you any body tell me the how to decrease the logfile  2
what is Archive old data?  1
How to Execute an Operating System Command From Within SQL Server ?  2
What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table HP12
What does it mean to have quoted_identifier on? What are the implications of having it off?  1
employee table has employee id ----------- empid ---------------- 1 2 3 3 3 4 5 5 5 6 6 6 7 here the values r repeated two times.how to select the repeated values only.i.e 3,5,6 should alone come.  1
Let’s say the table in the database is named as TBL_Register. The fields in this table include: 1. User_Name, 2. User_Telephone, 3. Register_Date The field Register_Date stores the current date and time of the registration. Write the SQL statement that inserts the data into the table. Techno-Solutions2
when we use function instead of procedure? plz tell me the situation with ex?  1
How to delete particular value in the column of a table.Is it possible or not?if possible give it as in query.  3
Let us say master db itself has no backup. Now you have to rebuild the db so what kind of action do you take?  1
Which stored procedure will you be running to add a linked server?  1
Different Types of Functions ? Satyam2
What is Covering Indexes? Plz explain with example  1
can we call stored Procedure in Function in Sql Server 2000 and vice versa. eSoft1
How will u get 5 years back record?  3
How m-m relationships are implemented?  1
select top 5 * from emp order by newid() my question is , how this query get executed?  2
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com