What is the basic difference in function and store procedure.where we use function and where we need to use Store Procedure.could you please explain me in brief.

Showing Answers 1 - 14 of 14 Answers

Naresh

  • Apr 18th, 2006
 

What ever we can achieve thru functions we can achieve everything thru stored proc's except the trignometrical calculations. when compared to a function, Stored proc's are faster in execution as they are pre-complied. We can use functions in scientific calculation(s) and for any other calculation tasks, whereas stored proc's are used and meant for grouping of queries and to improve or enhance the performance of the application.

  Was this answer useful?  Yes

srinadh

  • Sep 9th, 2006
 

In Sql Server 2005 function returns a value but stored procedure doesn't writen a value

syntax of functions:

declare function functionname () return datatye as

begin

return value

end

syntax of Procedures:

declare procedure procedure name ()  as

begin

end

  Was this answer useful?  Yes

A K Balamurugan

  • Apr 20th, 2007
 


Non-determinic function can be called inside Stored Procedure but not in function.

Ex of Non-determinic function

getdate()

newid()

  Was this answer useful?  Yes

anbum

  • Oct 19th, 2007
 

A procedure that performs an action and won't return any value

A function that computes a value, it will return some value
by
anbum

  Was this answer useful?  Yes

sampra

  • Mar 6th, 2012
 

procedure wont retrun any value but it can return many values on condition. but function always returns a values

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions