Guruji Point - Code You Want To Write

  • Home
  • Asp.Net
  • WCF
  • SQL
  • Type Script
  • AngularJS
  • Tech News
  • Blog
  • Earn Online

Wednesday, 1 November 2017

Difference Between Stored Procedure And Function In SQL - Interview Question

 Function and Procedure difference, guruji point, Gurujipoint, proc vs function, SQL, sql interview questions, stored procedure vs function     No comments   


Introduction
In this article we will learn what is the difference between Stored Procedure and SQL function. Most asked Interview question the difference between function and stored procedure.

Previous Updates
In previous articles we have learnt Inner Join using lambda expression. .Arrange Distinct Elements Of A List In Ascending Order Using LINQ 

To increase performance of our database, we need to concern with several aspects during database design. One of the most useful operations for performing those operations as well as maintaining efficiency is as follows:



Why Stored Procedure
Stored Procedures are pre-compile objects which are compiled for first time and its compiled format is saved which executes (compiled code) whenever it is called. But Function is compiled and executed every time when it is called which makes execution faster. Instead of retrieving data from sql queries we used Stored procedures or proc.

Difference between StoredProcedure and Function

  • Procedure can return zero, single or multiple values whereas Function must return a value 
  • Procedures can have input/output parameters whereas Function only have input parameters. 
  • Procedures can not be called from function whereas Functions can be called from Procedure.
  • Procedure allows DML (Insert/Update/Delete) and also SELECT statement whereas Function only allow Select statement.
  • Procedure can not be used with Where/ having sql conditional statement whereas function can be used with conditional statements.
  • Procedure can have transaction whereas Function can't.
  • Procedure can have try catch for Exception-Handeling whereas Function can't.

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Facebook Updates

Guruji Point

Categories

Comman table Expression in SQL Dynamic Grid Row IQueryable in c# Learn AngularJS Scope_Identity() Use of indexes comma seperated string in sql row_number() and dense_rank() salary table structure. while loop in sql why do we need cursor why tuple used

About Us

This blog is about the Programming ,Tech News and some intresting facts related Contents. Here you can find fundamental and expert level topic of programming languages very practically related to C# , Asp.Net ,Sql-Server, JavaScript, Jquery, WebServices And also Web-Api, WCF ,WPF, Angular Js.

Contact Us

Email Us - gurujipoints@gmail.com
Contact- 8077657477

Reach Us

Copyright © Guruji Point - Code You Want To Write