Explain the difference between functions and stored procedures in sql server?



Explain the difference between functions and stored procedures in sql server?..

Answer / Sandeep Kumar Jindal

Functions are reusable pieces of code that return a single value, while stored procedures are precompiled collections of SQL statements and optional control-of-flow structures that can accept parameters and return multiple results. Functions are typically used for calculations or to encapsulate logic within a single result, while stored procedures are often used to execute complex tasks such as transactions, data manipulation, and complex queries.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

How can we check the sql server version?

1 Answers  


What is a self join in sql server?

1 Answers  


What are window functions in sql server?

1 Answers  


What number sorts of privileges are accessible in sql?

1 Answers  


Where are SQL server users names and passwords are stored in sql server?

1 Answers   HCL,


How can I track the changes or identify the latest insert-update-delete from a table?

1 Answers  


Do you know what are the properties of the relational tables?

1 Answers  


Explain few examples of stored procedure over triggers?

1 Answers   ADITI,


Observed that some SP’s / Jobs are processing late, how to troubleshoot to improve performance?

1 Answers  


in emptable i want to retrive the name of employee whose name in 'J'char.exp: arjun,jagadesh,niranjan,anju,aaaj etc.

8 Answers  


Is INSTEAD OF trigger directly applicable to Table ?

1 Answers  


1. SELECT SUM(sal) as “Gross Salary” from EMPLOYEES; 2. SELECT MAX(sal) as “Highest Salary” from EMPLOYEES; ouput should be in table format

2 Answers  


Categories