What is difference between stored procedure & function?
Answer Posted / somu kattikar
Functions
----------
1) can be used with Select statement
2) Not returning output parameter but returns Table
variables
3) You can join UDF
4) Cannot be used to change server configuration
5) Cannot be used with XML FOR clause
6) Cannot have transaction within function
Stored Procedure
-----------------
1) have to use EXEC or EXECUTE
2) return output parameter
3) can create table but won’t return Table Variables
4) you can not join SP
5) can be used to change server configuration
6) can be used with XML FOR Clause
7) can have transaction within SP
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Can group functions be used in the order by clause in ms sql server?
Tell me what is the significance of null value and why should we avoid permitting null values?
What is snapshot parameter in ssrs?
How to list all schemas in a database?
Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?
What is the difference between NOROW and LOCKROW?
How to identify current user in ssrs report?
Explain what is scheduled job and how to create it?
How to change the data type of an existing column with "alter table" statements in ms sql server?
Tell me about the approaches which you used to counter the DI problems.
what does the automatic recovery do? : Sql server administration
Mention the different types of triggers?
How do users use Report Builder with SQL Server data sources?
Do you know how to make remote connection in database?