what is the difference between procedure and function.

Answers were Sorted based on User's Feedback



what is the difference between procedure and function...

Answer / plabana

1.StoreProcedure may return avalue may not return a value
but Function returns the value.
2.SttoreProcedure can be called independently using exec
keyword ,Function are called using select stmt.
3.StoreProcedure can create a table but can't return a table
where as Function can return a value.
4.Transaction related stmt can be handeled by StoreProcedure
Where as it can;t be handeled by Function.

Is This Answer Correct ?    17 Yes 0 No

what is the difference between procedure and function...

Answer / saraswathi muthuraman

Function :

1) Must return a single value. Only one value can be return
from a function.

2) Can be called from a sql(insert,update,delete) or
assignment st.U can't execute the function directly.

3) Can have DML,DDL,TLC inside function. But those function
can not be called from a sql.

Procedure :

1) Procedure can return multiple values.Procedure is
optional to return a value.

2) Can be executed directly and u can't called procedure
from sql.

3)Can have DML,DDL,TLC inside Procedure.

Is This Answer Correct ?    3 Yes 0 No

what is the difference between procedure and function...

Answer / hitesh

1.Procedure can call a function but Function cannot call
the function.
2.Procedure may or may not return the value but function
must return a scalar value.
3.Procedure can have any statements and function can have
only select like thing

Is This Answer Correct ?    0 Yes 0 No

what is the difference between procedure and function...

Answer / saurav kumar

1) Inside Stored procedure we can write functions but
inside function we can't write Stored procedures.

2) Stored proedure may or may not return a value but
function must return a value.

3) Stored Procedures can be called independently using exec
keyword ,Function are called using select statement.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Tell me what do you mean by an execution plan? Why is it used? How would you view it?

0 Answers  


what is the difference between them (ethernet networks and token ring networks)? : Sql server database administration

0 Answers  


How you can move data or databases between servers and databases in sql server?

0 Answers  


Explain ms sql server reporting services vs crystal reports?

0 Answers  


Can a database be shrunk with users active?

0 Answers  






What are sub-queries? Give example? In which case sub-queries are not feasible?

4 Answers   Infosys,


What are the types of indexes available with SQL Server?

2 Answers   Standard Bank,


What do you understand by user-defined function in the sql server and explain the steps to create and execute a user-defined function in the sql server?

0 Answers  


Get Current System Date Time

2 Answers  


How to disable triggers using "disable trigger"?

0 Answers  


Hi, I have a table A which has four rows as follows Table A ------- empname salary ------- ------ A 1000 B 2000 C 3000 A 1000 B 2000 D 5000 I need the following output: empname salary ------- ------ A 1000 A 1000 B 2000 B 2000 Thanks in advance

10 Answers   IBM,


Explain indexing and what are the advantages of it?

0 Answers  


Categories