Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Differnce between Stored procedure and user defined functions?

Answers were Sorted based on User's Feedback



Differnce between Stored procedure and user defined functions?..

Answer / chandra shaker

Stored Procedure returns morethan one value where as
Function returns only one value.

Is This Answer Correct ?    9 Yes 6 No

Differnce between Stored procedure and user defined functions?..

Answer / ranjanimanuel

1.UDF can't use a nondeterministic functions such as Getdate
(),RAND() where as StoreProcedure cn use such a functions.
2.UDF must return a value or a single resultset . Store
Procedure can return a value or even multiple resultsets,
but doesn't have to
3. UDF can be used in anywhere sql statements like
where/having/Select sections where as store procedure
cannot be.
4.UDFs that return table can be treated as another rowset.
This can be used in JOINS with other table

Is This Answer Correct ?    1 Yes 0 No

Differnce between Stored procedure and user defined functions?..

Answer / gowdhami

In UDF if any error comes it will stop the execution
but in SP it will skip the step move to next line

Is This Answer Correct ?    1 Yes 0 No

Differnce between Stored procedure and user defined functions?..

Answer / sharad kulat

Store Procedure Is first tme complie and make the
Execution plan & next time proc just call plan .so its get
execute fast.In case Function compile every request.

function & Store procedure return not only single but also
number of value .

function return number of value useing return type table.

You Can use Function with select ,case Statement ,same
thing can not do through Store procedure.

Is This Answer Correct ?    3 Yes 3 No

Differnce between Stored procedure and user defined functions?..

Answer / lalit raghuvanshi

20 main differences between Stored procedures and Functions
in Sql Server
http://www.webcodeexpert.com/2013/04/difference-between-stored-procedures.html

Is This Answer Correct ?    0 Yes 0 No

Differnce between Stored procedure and user defined functions?..

Answer / santosh kumar

Sl. No. User Defined function Stored Procedure
1 Function must return a value. Stored procedure may or not return values.
2 Will allow only Select statement, it will not allow us to use DML statements. Can have select statements as well as DML statements such as insert, update, delete
etc
3 It will allow only input parameters, doesn’t support output parameters. It can have both input and output parameters.
4 It will not allow us to use try-catch blocks. For exception handling we can use try catch blocks.
5 Transactions are not allowed within functions. Can use transactions within Stored procefures.
6 We can use only table variables, it will not allow using temporary tables. Can use both table variables aswell as temporary table in it.
7 Stored procedures can’t be called from function. Stored Procedures can call functions.
8 Functions can be called from select statement. Procedures can’t be called from Select/Where/Having etc statements. Execute/Exec
statement can be used to call/execute stored procedure.
9 UDF can be used in join clause as a result set. Procedures can’t be used in Join clause

Is This Answer Correct ?    0 Yes 0 No

Differnce between Stored procedure and user defined functions?..

Answer / asha

no difference

Is This Answer Correct ?    4 Yes 89 No

Post New Answer

More ADO.NET Interview Questions

What is oledb connection?

0 Answers  


What are three methods for displaying data in a syncfusion datagrid

0 Answers  


How to identify the controls which can be used for binding data?

0 Answers  


What is the difference between statement and preparedstatement interface?

0 Answers  


Explain the role of data provider in ado.net?

0 Answers  


Write steps of retrieving data using ado.net ?

3 Answers   Keane India Ltd,


Why do we serialize data?

0 Answers  


How to copy the contents from one table to another table and how to delete the source table in ado.net?

0 Answers  


how to add a selected row of a gridview to another gridview without reloading the page??

2 Answers  


Which is the feature of ado.net?

0 Answers  


Which method is used to sort the data in ADO.Net?

0 Answers  


What do you mean by performing asynchronous operation using command object?

0 Answers  


Categories