Difference between Stored Procedure and Function



Difference between Stored Procedure and Function


Distinguish, differentiate, compare and explain what is the difference between Stored Procedure and Function. Comparison and Differences.

Difference between Stored Procedure and Function

1. Stored Procedure can return zero , single or multiple values. Function can return one value which is mandatory.

2. We can use transaction in Stored Procedure. We cant use transaction in User Defined Function.

3. Stored Procedure can have input/output parameter. User Defined Function have only input parameter.

Difference between Stored Procedure and User Defined Function

4. We can called function from Stored Procedure. We cant call Stored Procedure from function.

5. We cant use Stored Procedure in SELECT/ WHERE/ HAVING statement. We can use User Defined Function in SELECT/ WHERE/ HAVING statement.

6. We can use exception handling using Try-Catch block in Stored Procedure. We cant use Try-Catch block in User Defined Function.



Tags:

Difference between Function vs Stored Procedure

Stored Procedure vs Function

Differences between Function vs Stored Procedure

Image Credits: Freepik

Search a Phrase in the Steadyrun



Why and How

Spreading Knowledge Across the World

  • United States
  • United Kingdom
  • India
  • Nigeria
  • Philippines
  • Pakistan
  • Nepal
  • Singapore
  • Indonesia
  • Bangladesh
  • Ghana
  • United Arab Emirates
  • Kenya
  • Canada
  • Malaysia
  • Australia
  • Iran
  • South Africa
  • Uganda
  • France
  • Ireland
  • Unknown Region
  • Egypt
  • Tanzania
  • Ethiopia
  • Thailand
  • Sri Lanka
  • Cameroon
  • Hong Kong
  • Spain
  • Vietnam
  • New Zealand
  • Japan
  • Brazil
  • Saudi Arabia
  • Zambia
  • Czechia
  • Italy
  • Russia
  • Myanmar (Burma)
  • Netherlands
  • Germany
  • Romania
  • Mexico
  • Rwanda
  • Sierra Leone
  • Turkey
  • Zimbabwe
  • Poland
  • Iraq
  • Cyprus
  • Algeria
  • Liberia
  • Greece
  • Jamaica
  • Malawi
  • Qatar
  • Portugal
  • South Korea
  • Argentina
  • Colombia
  • Morocco
  • Peru
  • Kuwait
  • Lithuania
  • Finland
  • Somalia
  • Israel
  • Bulgaria
  • Chile
  • Hungary
  • Trinidad & Tobago
  • Uzbekistan
  • Ukraine
  • Sweden
  • Kazakhstan
  • Norway
  • Macedonia
  • Benin
  • Switzerland
  • Oman
  • Botswana
  • Belgium
  • Ecuador
  • Slovakia
  • China
  • Croatia
  • Brunei
  • Serbia
  • Papua New Guinea
  • Bahrain
  • Guyana
  • Denmark
  • Lesotho
  • Lebanon
  • Jordan
  • Azerbaijan
  • Latvia
  • Cambodia
  • Namibia
  • Mauritius
  • Austria
  • Mongolia
  • Albania
  • Libya
  • Gambia
  • Taiwan
  • Bhutan
  • Venezuela
  • Dominican Republic
  • Tunisia
  • Luxembourg
  • Bosnia & Herzegovina
  • Guatemala
  • Solomon Islands
  • Guam
  • Costa Rica
  • Yemen
  • Bolivia
  • and many more ...