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

Difference between Function and Stored Procedure?

Answer Posted / mohammad sajid

Although both functions and sp's are prcomiled sql
statements there exists some differences between them.

1. Functions must return a value(scalar,inline table or
multi statement table) whereas stored proc may or may not
retun a value.
2.Functions can return a table whereas stored procs can
create a table but can't return table.
3. Stored procs can be called independently using exec
keyword whereas function are called using select statements.
4. Stored procs can be used to change server configuration
(in terms of security-i.e. setting granular permissions of
user rights) whereas function can't be used for this
5. XML and output parameters can't be passed to functions
whereas it can be with sp's.
6.transaction related statement can be handled in sp
whereas it can't be in function.
7. stored procedures can call a funtion or another sstored
proc similarly a function can call another function and a
stored proc.The catch with function is that no user defined
stored proc can be called.Only extended/system defined
procs can be called.

Hope this will be helpful and if there's any correction let
me know.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is a full-text index updated?

895


What is an expression in ms sql server?

1008


What is ddl and dml commands?

846


Difference between group by clause and having clause in SQL?

925


What is the dbcc command and why is it used?

993


What command is used to create a database in the sql server and how?

1111


Comment,Datatypes are unlimited

2015


What do you understand by mirroring and mention the advantages of the mirroring?

1008


Explain what is sql server english query?

985


How to find the service pack installed? : sql server database administration

970


How to query multiple tables jointly?

918


What is isnull() operator?

973


What is a print index?

840


How to include date and time values in sql statements?

1040


How to search for a string in all stored procedure in sql server?

949