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

Are connections to sql server encrypted?

0 Answers  


What are the general features of sql server management studio? : sql server management studio

0 Answers  


what are the main differences between ms access and sqlserver

1 Answers   C DAC, CDAC,


as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration

0 Answers  


How raid can influence database performance?

0 Answers  






When columns are added to existing tables, what do they initially contain?

0 Answers  


How do you troubleshoot SQL Server if its running very slow?

2 Answers   HP,


List out some of the requirements to set up a sql server failover cluster?

0 Answers  


Give the query of getting last two records from the table in SQL SERVER?

0 Answers   Petranics Solutions,


What is field with example?

0 Answers  


how to rename the table

3 Answers  


What are constraints?

0 Answers  


Categories