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
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
How do I connect to sql server database?
What is the purpose of sql profiler in sql server?
What is the osql utility?
What are the commands used in DCL?
Explain features and concepts of analysis services?
What are clustered and non-clustered index?
Write a query for primary key constraint with identity key word?
How to find the version of sql server? : sql server database administration
Explain tables in SQL Azure?
What is isnull() operator?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
Differentiate between sql temp table vs table variable?
How do users use Report Builder with SQL Server data sources?
Does sql server 2016 have ssms?