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

How to count groups returned with the group by clause in ms sql server?

0 Answers  


How to create user messages with print statements in ms sql server?

0 Answers  


What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?

0 Answers  


What is the use of MOVE keyword in restore command

3 Answers   IBM,


What is a DBMS, query, SQL?

0 Answers   Maveric,


Types of Authentications in Sql Server? How user gets authenticated through windows authentication?

0 Answers   MCN Solutions,


What is collation sensitivity? Explain different types.

0 Answers  


What are the restraints imposed on the table design by a merge replication?

0 Answers  


How to update muliple row in single query?

0 Answers   MCN Solutions,


Can we create SP inside SP ? If no Y ? If yes Y ? Explain with an example ?

3 Answers   IBM, L&T,


How many categories of functions based their return modes?

0 Answers  


Advantages and Disadvantages of Cursor?

15 Answers   Polytechnic, TCS, Zenith,


Categories