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...


What is difference between stored procedure & function?

Answers were Sorted based on User's Feedback



What is difference between stored procedure & function?..

Answer / khurram

1>Procedure can return zero or n values whereas function can
return one value which is mandatory.

2>Procedures can have input,output parameters for it whereas
functions can have only input parameters.

3>Procedure allow select as well as DML statement in it
whereas function allow only select statement in it.

4>Functions can be called from procedure whereas procedures
cannot be called from function.

5>Exception can be handled by try-catch block in a procedure
whereas try-catch block cannot be used in a function.

6>We can go for transaction management in procedure whereas
we can't go in function.

7>Procedures cannot be utilized in a select statement
whereas function can be embedded in a select statement.

Is This Answer Correct ?    17 Yes 3 No

What is difference between stored procedure & function?..

Answer / shreenath27@yahoo.co.in

function will return value but procedure will not return any
value

Is This Answer Correct ?    6 Yes 4 No

What is difference between stored procedure & function?..

Answer / 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

More SQL Server Interview Questions

how can ur insert the emp table

3 Answers   Wipro,


Explain SELF JOIN ?

3 Answers   ADP,


What types of Joins are possible with Sql Server?

0 Answers   NA,


What is the SQL?????????????????????????????

5 Answers   CMS,


What number sorts of privileges are accessible in sql?

0 Answers  


How to display n-1 columns from n number of columns, from a single table in MS SQL server 2005?

2 Answers  


What will be the maximum number of index per table?

0 Answers  


What is precedence constraint?

0 Answers  


What is Left Outer Join?

2 Answers  


What is the difference between drop table and truncate table?

0 Answers  


You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date

0 Answers  


how to select 5 to 7 rows from a table, which contains 10 rows?

21 Answers   IBM,


Categories