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-in general?

Answers were Sorted based on User's Feedback



Difference between Function and Procedure-in general?..

Answer / sudhindra

A Function is always returns a value using the return
statement. A Procedure may return one or more values
through parameters or may not return at all.

Is This Answer Correct ?    28 Yes 6 No

Difference between Function and Procedure-in general?..

Answer / dharmendra nonia

Function and Stored Procedure both are precompiled objects
in databases but there is some difference between UDFs and
Stored Procedure such as--
1)Function Must be return at least one value but stored
procedure may or may not.
2)We can use Function for only data manipulation but stored
Procedure is used to Manipulation as well as Modification
of Data on tables.
3)We can't use DML statements inside Function but In stored
Procedure, we can use DML statements.
4)In stored Procedure, we can pass INPUT and OUTPUT
parameter but Function accept only input parameter and
return a value.

Is This Answer Correct ?    13 Yes 2 No

Difference between Function and Procedure-in general?..

Answer / mona

Function can return at most one value at a time while
procedure can return more than one value at a time You can
use function within Sql Statement and you cannot use stored
procedure with in Sql Statement

Is This Answer Correct ?    19 Yes 11 No

Difference between Function and Procedure-in general?..

Answer / arif

function can not have update,delete or insert statement but
Stored procedure can have

Is This Answer Correct ?    15 Yes 9 No

Difference between Function and Procedure-in general?..

Answer / rohan

function can be written in select statement but stored
procedure cannot be written in a select statement

Is This Answer Correct ?    9 Yes 6 No

Difference between Function and Procedure-in general?..

Answer / s.chandrahasan

A stored procedure is like a miniture program in SQL Server.
It can be as simple as a select statement, or as complex as
a long script that adds, deletes, updates, and/or reads data
from multiple tables in a database. (Stored procedures can
also implement loops and cursors which both allow you to
work with smaller results or row by row operations on data.)

The SQL Server functions are option for doing certain
operations in SQL Server. They can not be used to update,
delete, or add records to the database. They simply return a
single value or a table value. They can only be use to
select records. However, they can be called very easily from
within standard SQL, such as:

SELECT dbo.functionname('Parameter1')

OR

SELECT Name, dbo.Functionname('Parameter1') FROM sysObjects

For simple reusable select operations, functions can simply
your code. Just be wary of using JOIN clauses in your
functions. If your function has a JOIN clause and you call
it from another select statement that returns multiple
results, that function call with JOIN those tables together
for EACH line returned in the result set. So though they can
be helpful in simpling some logic, they can also be a
performance bottleneck if they're not used properly.

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More SQL Server Interview Questions

What are sql server procedures?

0 Answers  


What happens if you delete a table that is used by a view?

0 Answers  


how you can list all the tables in a database?

0 Answers  


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

0 Answers  


What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?

0 Answers  


When to use Inner join & when to use subquery?

0 Answers   IBM,


What is difference between view and materialized view?

0 Answers  


Explain the difference between clustered and non-clustered index?

0 Answers  


You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?

0 Answers  


What is the difference between locking and multi-versioning?

0 Answers  


What is co-related sub query?

0 Answers  


What are the operating modes in which database mirroring runs?

0 Answers  


Categories