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  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
Difference between Triggers and Stored Procedure
 Question Submitted By :: Senthil_allinterview
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 1
stored procedure 

Definition

please give me Answer
 
Is This Answer Correct ?    6 Yes 3 No
Rajani Kant
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 2
Stored Procedures are called by the programmer wherever it 
wants to fire but triggers fired automatically when 
insert,delete,update occured. And triggers can be 
implemented to tables & views only where as s.p used in the 
database independently
 
Is This Answer Correct ?    9 Yes 1 No
Ram
 
 
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 3
To use stored procedure you have to make a call to that
procedure but Triggers fired automatically when an event is
occurred on the table associated with that Trigger like add,
insert or delete.
 
Is This Answer Correct ?    13 Yes 1 No
Pankaj Arya
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 4
Stored Procedure can give one output paramenter,but 
Triggers can not give any output parameter
 
Is This Answer Correct ?    7 Yes 2 No
Gopal Chauhan
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 5
1. SP may Return a value but Trigger Not,
2. In SP you can pass parameter But in trigger you can't
3. we explicitly call the Sp when Trigger are implicitly 
fired
4. you can write a sp in Trigger but in a Trigger you cant 
write SP.
5. Trigger written on an individual Table or View where SP 
is written for an Database
 
Is This Answer Correct ?    7 Yes 7 No
Ghanshyam Vrema
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 6
In case of sql queries,it is possible to compile one query 
at a time,but incase of stored procedure we can compile 
bunch of queries at a time and also it is need at first 
time only,suppose we need modification on queries,after 
modifications no need to compile again in case of stored 
procedures,but in case of sql queries we have to compile 
every time.Stored procedure contain queries in compiled 
format so execution also fast and tome saving.One more 
thing is in case of stored procedures serurity also more.
 
Is This Answer Correct ?    3 Yes 2 No
Gangi Naidu.k
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 7
sp and trigger are both predefined set of sql statements

we can pass the arguments for sp but we cant pass the 
arguments for triggers.

trigger will fire implicitly, when ever relavent action 
performed by the user on the tables where the triggers are 
placed.

But in the stored procedures u must call explicitly.
 
Is This Answer Correct ?    5 Yes 2 No
Madhu Prakash P
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 8
1. Triggers can only be implemented on tables or views but 
Stored Procedure in independent code that can be specific 
to database.

2. Triggers are automatically run but stored procedures are 
not automatically run and they have to be called explicitly 
by the user.

3. we can write a stored procedure within a trigger but 
cannot write a trigger within a stored procedure.

4. Trigger is attached to table or view and is fired only 
when an INSERT, UPDATE, and/or DELETE occurs, while a 
stored procedure executes at any time when it is called.
 
Is This Answer Correct ?    8 Yes 2 No
Bed Singh
 
  Re: Difference between Triggers and Stored Procedure
Answer
# 9
1. Stored Procedure may Return a value but Trigger Not,
2. In Stored Procedure you can pass parameter But in 
trigger you can't
3. we explicitly call the Stored Procedure when Trigger are 
implicitly 
fired
4. you can write a Stored Procedure in Trigger but in a 
Trigger you cant 
write Stored Procedure.
5. Trigger written on an individual Table or View where 
Stored Procedure 
is written for an Database
 
Is This Answer Correct ?    2 Yes 1 No
Avdhesh Yadav
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
i want table name basis on column name.  5
What's the difference between a primary key and a unique key? Wipro8
what is replication? where do u use Go Keyword? Satyam1
What is cursor ? And what is difference between Trigger ? HCL1
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
i have table students with fields classname,studname select * from students classname studname 1 xxxxx 1 yyyy 1 zzzz 2 qqqq 2 tttt 3 dsds 3 www i want the output should be No of students in class 1 : 3 No of students in class 2 : 2 No of students in class 3 : 2 HCL2
explain different types of jions with examples briefly? Zensar2
what is extended StoreProcedure ? Satyam3
Plz tell about backup&recovery?  2
What is Files and Filegroups in SQL Server & it's implementation. Zenith1
What is an extended stored procedure? Can you instantiate a COM object by using T-SQL? HCL3
The Difference between 'Count' and 'Count(*)'  12
plz tell me the new features of sqlserver2000,sqlserver2002,sqlserver2005  3
can you any body tell me suppose database is suspect mode. how can take to normal? Teledata1
Can store procedure call by user define function in SQL server? HCL6
what are three different authentications to connect linked servers? CitiGroup1
How to work on DTS?what is the main requirement? ivan1
Can you give an example of Stored Procedure?  2
How to count the number of duplicate items in a table?  1
Difference between server.transfer and server.execute method?  1
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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