GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Database  >  SQL Server
Go To First  |  Previous Question  |  Next Question 
 SQL Server  |  Question 4 of 99    Print  
What is the difference between "procedure" and "function"?

  
Total Answers and Comments: 21 Last Update: June 08, 2009     Asked by: Beena 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: vikas
 

The main differences are :-

1. Functions must return a value while procedure may or may not return any value.

2. Function can return only a single value at a time while procedure can return one, many or none.

3. Function can be called from sql statements while procedures can't.



Above answer was rated as good by the following members:
infoeweb, boreddy, Prasadp17
  Sorting Options  
  Page 1 of 3   « First    1    2    3    >     Last »  
September 20, 2005 06:43:10   #1  
rahultripathi Member Since: September 2005   Contribution: 22    

RE: What is the difference between "procedure" and "fu...

The difference mejor between procedure and function is that function must return value. that should be only single and function can pass any no. parameter but come out only one value only using return statement.

procedure can pass any parameter and came out any no. of values there no any RETURN word.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 28, 2005 08:12:54   #2  
NAVEEN KUMAR        

RE: What is the difference between "procedure" and "fu...
The major difference between procedure and function is that procedure is to be compile only one time and vice versa.Execution of procedure is faster then function
 
Is this answer useful? Yes | No
September 28, 2005 08:30:56   #3  
NAVEEN KUMAR        

RE: What is the difference between "procedure" and "fu...
The major difference between procedure and function is that procedure is to be compile only one time and vice versa.Execution of procedure is faster then function
 
Is this answer useful? Yes | No
October 10, 2005 04:45:01   #4  
Ramesh. S        

RE: What is the difference between "procedure" and "fu...
1.The major difference between procedure and function is that procedure is to be compile only one time.Execution of procedure is faster then function
 
Is this answer useful? Yes | No
October 10, 2005 04:48:53   #5  
Ramesh. S        

RE: What is the difference between "procedure" and "fu...

1.The major difference between procedure and function is that procedure is to be compile only one time and vice versa.Execution of procedure is faster then function

2.Function can be used in select Queries statement but in stored procedure it's not possible.

3.Fuction can return a single value only.Stored procedure return more than one value.


 
Is this answer useful? Yes | No
October 17, 2005 02:30:20   #6  
Azhagu Pandian        

RE: What is the difference between "procedure" and "fu...
The major difference between procedure and function is that 1. Procedure can be compiled only once and vice versa. 2. Execution of procedure is faster then function 3. Function can be used in select Queries statement in stored procedure. But it's not possible using straight away. 4. Function can return a single value only.Regards Azhagu
 
Is this answer useful? Yes | No
October 21, 2005 06:41:38   #7  
Ramesh        

RE: What is the difference between "procedure" and "fu...
differece
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 04, 2005 07:32:49   #8  
gayathri        

RE: What is the difference between "procedure" and "fu...

function returns a value

procedure doesnot return a value


 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
November 07, 2005 06:42:27   #9  
kautilya        

RE: What is the difference between "procedure" and "fu...

SP excepts


 
Is this answer useful? Yes | No
November 07, 2005 06:44:19   #10  
kautilya        

RE: What is the difference between "procedure" and "fu...

SP Accepts both i/p and o/p paramateres where function accespts only i/p paramateres fuction can be used in select stmt as well as function can be used as user defined datatype


 
Is this answer useful? Yes | No
  Page 1 of 3   « First    1    2    3    >     Last »  


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape