What is difference between stored procedure and function?

Answers were Sorted based on User's Feedback



What is difference between stored procedure and function?..

Answer / rakesh

mojor difference is
function must return a value but a
procedure may or may not return a value

Is This Answer Correct ?    8 Yes 1 No

What is difference between stored procedure and function?..

Answer / a.suresh

1.Stored Procedure return 0 to nth value where as function
return only one value which is must.
2.we can't use the stored procedure in select select
statement where as function can be used in the select statement.
3.we can use all the dml(insert,update,delete) commands in
stored procedure where as select statement only used in
functions.
4.we can use try catch in stored procedure where as in
functions cant.
function must be used with its schema where as stored
procedure used with out schema name
ex.dbo.function name

Is This Answer Correct ?    2 Yes 0 No

What is difference between stored procedure and function?..

Answer / g.ashok

Stored Procedure need not to return a value.
Function should return a value.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

how we can store the value like that 001,003,023 etc in sql server 2005

7 Answers  


What is the difference between a clustered index and a non-clustered index?

0 Answers  


What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas

0 Answers  


How to connect php with different port numbers?

0 Answers  


Do you know what is xpath?

0 Answers  


How you can find out if an index is useful to the optimizer?

0 Answers  


I have a table Events Events containing cardno,time,id,name--each id has a cardno my requirement is every day each employee swipe the card several times i want to calculate first and last time of each card the output should be name 1 2 6 7 in out in out holiday holiday xxx 09:30 06:30 09:40 06:45 where 1,2...... are dates for example january 1,2, etc. 6 and 7 are saturday and sunday how it is posssible

0 Answers   HCL, Wipro,


wat wil hapn if we give the both read and deny read permission to user?

0 Answers   IBM,


How can you control the amount of free space in your index pages?

0 Answers  


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

0 Answers  


Can we return Data from 4(more than 1) tables in stored procedure?

0 Answers   HCL,


What is filter index?

0 Answers  


Categories