Differnce between Stored procedure and user defined functions?
Answers were Sorted based on User's Feedback
Answer / ashok
Main difference between sp and function is we cannot use
store procedure in select statement where as we can use
function in select statement.
| Is This Answer Correct ? | 32 Yes | 4 No |
Answer / suresh jayaraman
Procedure-is also called Proc
proc-parsing resloving organizing compiling
stored Procedure once compiled and run many times,when we
create procedure,that procedure is stored in executeplan,so
no need to recompile.
but fuction every time compiling and running.
| Is This Answer Correct ? | 21 Yes | 4 No |
Answer / suresh mandala
1>Stored Procedure returns morethan one value where as
Function returns only one value
2>stored procedure we may use return statement.. but in
userdefined function we should use return statement
3>stored procedure is precomplied but function compile each
time we call it.
If u have any quieries ask me ,i will try
| Is This Answer Correct ? | 17 Yes | 1 No |
Answer / shivendra pandey
stored procedure is precomplied and not return value by
default but function compile each time and use return
statement simply.
if u r using database then use stored procedure for
pefmance n if u are working with simple pl for some
calculation go for function
| Is This Answer Correct ? | 15 Yes | 3 No |
Answer / ramesh
stored procedure we may use return statement.. but in user
defined function we should use return statement
| Is This Answer Correct ? | 14 Yes | 5 No |
Answer / urvish
store procedure can return Output Parameters where function
can not return output parameters.
| Is This Answer Correct ? | 12 Yes | 4 No |
Answer / suraj
1)sp are pre comiled so while execution time it save time
2)sp returns many values where as function return only one
value
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / saiprasad
u cannot change any datatype in database using udf
u can do everything with a storedprocedure
udf cannot be used in XMl Clause but sp's can be used
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / sivacharan svs
Funtion Should Return a value
Procedure may or may not return a value
Function can be used in Your Select Quries
Procedure has to be passed with or with out parameters
Select Getdate() as date
Function returns date time here
The resultant value of the stored procedure can be used in
application where as the resultant value of the stored
procedure is used in a query.
| Is This Answer Correct ? | 4 Yes | 0 No |
can u tell me the why ADO does not support xml..
How to pass multiple tables in datasets simultaneously?
What is the maximum pool size in ado.net connection string?
What is the full form of ado?
How to check if a datareader is closed or opened? IsClosed()
If a table contains 20000 records . In a page at each time 100 records to be displayed what are the steps you will take to improve performance? Will you use dataset or datareader?
What is typed dataset ?
Explain the difference between an ado.net dataset and an ado recordset?
What are the key features of ado.net?
What are the different ado.net namespaces?
How can I retrieve two tables of data at a time by using data reader? Data reader read and forward only, how is it possible to get 2 tables of data at a time?
Define partial class?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)