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

Differences between functions and stored procedures?

Answer Posted / samba shiva reddy . m

1. Functions are compiled and executed at run time.
Stored procedures are stored in parsed and compiled format in the database(Pree compiled).

2. Functions cannot affect the state of the database which means we cannot perform insert,delete,update and create operations on the database.
Stored Procedures can affect the state of the database by using insert,delete,update and create operations.

3 Functions are basically used to compute values. We passes some parameters to functions as input and then it performs some operations on the parameter and return output.
Stored procedures are basically used to process the task.

4.Function can not change server environment and our operating system environment.
Stored procedures can change server environment and our operating system environment.

5.Functions can invoked from SQL Statements.
example : select udf from table name

Stored procedures can't invoked from SQL staements.
example : select spname from table name

6.Functions can run an executable file from SQL SELECT or an action query.
operating system use Execute or Exec to run

7.We can use User Defined function in Stored procedure
we can't use stored procedure in UDF.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between left and right outer join?

1112


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

2414


What does executeupdate return?

1033


What is used to replicate sessions between instances in coldfusion clusters?

1101


What is difference between equi join and inner join?

1038


Differentiate between SQL and ORACLE joins and write their syntax.

1071


What is an execution plan? When would you use it?

1026


How to find table changes in sql server?

1173


Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?

128


How to defragment indexes with alter index ... Reorganize?

1137


What are scalar functions in sql?

1208


How will you decide the active and passive nodes?

1179


How to delete duplicate rows?

1036


What is merge join?

1238


Is it possible for a stored procedure to call itself or recursive stored procedure?

1003