Skip to main content

Difference between SQL Function and Stored Procedure

The main difference between functions and stored procedures  are given bellow:
Function(User Defined)
  1. It returns only one value
  2. We can’t use transaction in function
  3. Only have input parameter
  4. We can’t called SP from function
  5. We can’t use exception handling using Try-Catch block in function
  6. We can use function in select/where/having statement
Stored Procedure (Store Procedure)
  1. It returns zero, single or multiple values
  2. We can use transaction in SP
  3. Can have input/output parameter
  4. We can called function from SP
  5. We can use exception handling using Try-Catch block in SP
  6. We can’t use SP in select/where/having statement

Comments

Popular posts from this blog

Asp.net Component Model

ASP.Net Component Model: The ASP.Net component model provides various building blocks of ASP.Net pages. Basically it is an object model, which describes: ·          Server side counterparts of almost all HTML elements or tags, like <form> and <input>. ·          Server controls, which help in developing complex user-interface for example the Calendar control or the Gridview control. ASP.Net is a technology, which works on the .Net framework that contains all web-related functionalities. The .Net framework is made of an object-oriented hierarchy. An ASP.Net web application is made of pages. When a user requests an ASP.Net page, the IIS delegates the processing of the page to the ASP.Net runtime system. The ASP.Net runtime transforms the .aspx page into an instance of a class, which inherits from the base class Page of the .Net framework. Therefore, each ASP.Net page is an object and a...