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


diffrance between stored procedure & function in sql server?

Answers were Sorted based on User's Feedback



diffrance between stored procedure & function in sql server?..

Answer / dev

Difference between function and stored proc:
========================================================

Stored Procedure :supports deffered name resoultion Example
while writing a stored procedure

that uses table named tabl1 and tabl2 etc..but actually not
exists in database is allowed

only in during creation but runtime throws errorFunction
wont support deffered name

resolution.
2. Stored procedure returns always integer value by default
zero. where as function return

type could be scalar or table or table values(SQL Server).
3. Stored Procedure is pre compiled exuction plan where as
functions are not.
4. Stored Procedure retuns more than one value at a time
while funtion returns only one

value at a time.
5. We can call the functions in sql statements (select max
(sal) from emp). where as sp is

not so
6. Function do not return the images,text whereas sp
returns all.
7. Function and sp both can return the values. But function
returns 1 value only.
procedure can return multiple values(max. 1024) we can
select the fields from function. in

the case of procdure we cannot select the fields.
8. Functions are used for computations where as procedures
can be used for performing

business logic
9. Functions MUST return a value, procedures need not be.
10. You can have DML(insert, update, delete) statements in
a function. But, you cannot call

such a function in a SQL query..eg: suppose, if u have a
function that is updating a table..

you can't call that function in any sql query.
- select myFunction(field) from sometable;
will throw error.
11. Function parameters are always IN, no OUT is possible

Is This Answer Correct ?    5 Yes 0 No

diffrance between stored procedure & function in sql server?..

Answer / pramod prakash

Function can be used in an expression but we cann't use
procedure in an expression

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Can we set master page as a start page?

0 Answers  


When should we use abtract class and Interface Class?Give an Example

4 Answers   Accenture, Cap Gemini, L&T, RM,


When you use Ajax controls in the ASP.NET application?

0 Answers   Viscus Infotech,


Why cyclomatic complexity is important?

0 Answers  


How can you provide an alternating color scheme in a Repeater control?

6 Answers   Siebel Systems,


What are the type of session in Asp.Net

3 Answers  


what are Httpmodule and HttpHandler?

3 Answers   Microsoft, Wipro,


what do machine key element in configuration file specify?

1 Answers   TCS,


how to increase performance of web site? if there is a page with high load. the content is high then what should we do to increase performance?

3 Answers   Emphasis, Mphasis, TCS,


How many web.config files in each solution

10 Answers   General Mills,


Usage of web.configuration ?

3 Answers   Microsoft,


What is break mode?

0 Answers  


Categories