DIFFERENCE BETWEEN STORED PROCEDURES AND FUNCTIONS IN SQL | SQL Interview Question | IQBees

preview_player
Показать описание
Hello Friends,

Difference between stored procedure and function is the most asked question in the interview. Most of us are aware about it but this video is for those who are new to sql or planning for an interview.

DIFFERENCE BETWEEN STORED PROCEDURES AND FUNCTIONS IN SQL

1. Stored Procedures are pre-compiled objects which are compiled for the first time and its compiled format is saved, which executes (compiled code) whenever it is called.

A function is compiled and executed every time whenever it is called.

2. An exception can be handled by try-catch block in a Procedure whereas try-catch block cannot be used in a Function.

3. We can use Transactions in Procedure whereas we can't use Transactions in Function.

4. The function must return a value but in Stored Procedure it is optional. Even a procedure can return zero or n values.

5. Functions can be called from Procedure whereas Procedures cannot be called from a Function.

6. The procedure allows SELECT as well as DML(INSERT/UPDATE/DELETE) statement in it whereas Function allows only SELECT statement in it.

7. Function can be used with Select, Where and Having Clause and even used with joins as well But, Can't use same with procedure

Regards,
IQBees

difference between functions and stored procedures in sql server,difference between functions and stored procedures in sql server hindi,difference between functions and stored procedures,difference between stored procedure and function in sql server in hindi,difference between stored procedure and function in sql server,difference between stored procedure and function,what is the difference between stored procedure and function in sql

#differencebetweenstoredprocedureandfunctioninsql #differencebetweenstoredprocedureandfunctioninsqlserver
#storedprocedureandfunction
Рекомендации по теме
Комментарии
Автор

Short and up to the mark. Unlike others, there is not a single word spoken out of the topic which I really appreciate. 👍

minitam
Автор

Best thing about your videos is You take very less time to cover many things and yet explaining it so beautifully.. Thanks for spreading the knowledge.. 👍🏻

bachpanzone
Автор

Clear Explains difference between these two. Thanks for giving these types videos that's help in interview for these type of questions👌👌

luckychauhan
Автор

Short, simple and clear explanation.. Really liked it so much:)

technicalaj
Автор

Great tutorials. Thank You very much. looking forward for more videos from you.

moviemania
Автор

Your videos help me to understand the basics

probeautyadvice
Автор

Thanks for the short and required details...

SureshK-enzx
Автор

T-SQL Functions cannot use temp tables.

philgardocki
Автор

Then use case for function if it lacks in all these aspects

kaushikbudi
Автор

Nice video but can I get a video on stored procedure and views

studking