.NET and SQL Server Interview Question - Difference between Stored Procedure and Function?

 Posted by ArticlesMaint on 4/9/2011 | Category: Sql Server Interview questions | Views: 3177

Function are compiled and executed at run time.
Stored Procedure are stored in parsed and compiled format in the database.

Function cannot affect the state of the database which means we cannot perform CRUD operation on the database.
Stored Procedure can affect the state of the database by using CRUD operations.

Store Procedure can return zero or n values whereas Function can return only one value.

Store Procedure can have input,output parameters for it whereas functions can have only input parameters.

Function can be called from Stored Procedure whereas Stored Procedure cannot be called from Function.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response