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 procedure

Answer Posted / manub22

- Stored Procedures can contain a single SQL statement or a group of SQL statements with data flow control logic containing IF-ELSE, WHILE loop constructs, TRY-CATCH, transactions, etc.
SPs are used to return one or many result-sets to its calling application.

- On the other hand Functions or UDFs can contain single or multiple SQL statements depending on its type. A Scalar UDF & Inline UDF can only have a single SELECT statement. And a Multi-Statement UDF can contain a body with multiple SQL statements including SELECTS, IF-ELSE, WHILE loops and DMLs but limited to manipulating table variables only.
UDFs return a single Scalar value or a Table variable to the calling SELECT statement.

Check all the difference here:
http://sqlwithmanoj.com/2011/09/21/stored-procedures-vs-functions-difference-between-sp-udf/

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to name query output columns in ms sql server?

956


How dts is used to extract, transform and consolidate data?

1067


How to sort query output in descending order in ms sql server?

938


How would you use user_constraints table in DB?

998


List all the types of user-defined functions?

1085


What is attribute hierarchy? : sql server analysis services, ssas

1007


Is ssrs support other database except ms sql server?

139


What are differences in between sql server 2012 and sql server 2016?

1033


What are the essential components of sql server service broker?

1013


What is multilevel indexing?

922


What is sql server schema compare? How we can compare two database schemas?

1018


How do I setup a local sql server database?

989


Which data type columns are the best candidates for full-text indexing?

960


Tell me in brief how sql server enhances scalability of the database system?

980


How to get the definition of a stored procedure back?

973