diffrence between function and procedure
Answers were Sorted based on User's Feedback
Answer / srinivas k
Function should always return a value, where as Store Proc
may or may not return values.
Functions can be part of DML statements, where SP cannot be.
SP are precompiled and functions are not.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sakthi
Inside function we cannot able to insert, udate or delete
any record but in procedure we can use it. inside function
we cannot able to call any other functions or procedure but
inside procedure we can call other procedure and functions.
these are the major differences
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / pradeep aryan
1. Function can returtn single value but proc san return
multiple values
2. Proc can call a function but function not.
3. function can call in select statement also and acn perform
action also but proc not.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / jayanth
Functions always returns a value where as sp performs bath execution
functions can be used along with select statement and where clause where as functions cannot be used with update insert delete statements in which sp cannot be used with select and DML events
functions cannot be used with try catch block where as sp can use try catch block
functions are of two types system functions and user defined functions where as sp's are four types mostly
sp with parameters
sp without parameters
sp with out parameters
sp with return values
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rakesh
function always return value, and procedure not Return the value.
| Is This Answer Correct ? | 2 Yes | 3 No |
What is correlated subquery in sql server?
i want to create procedure for create table in sql server 2005 for example create procedure create_table @table varchar(20) as create @table( id int, name char(20) ) but it will get error what is solution?
Write an sql query to find the names of employees start with ‘a’?
Tell me what is use of except clause? How it differs from not in clause?
What are relationships and mention different types of relationships in the dbms
What is difference between drop truncate and delete?
What is the sql case statement used for? Explain with an example?
What is the difference between temp table and table variable?
Explain different types of lock modes in sql server 2000?
Create and insert into temp table in sql server?
How is a full-text index updated?
What is the use of MOVE keyword in restore command
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)