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 to rename an existing table with the "sp_rename" stored procedure in ms sql server?

0 Answers  


What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

0 Answers  


Explain transaction server implicit?

0 Answers  


How to work on DTS?what is the main requirement?

1 Answers   Getit, ivan,


Hi Friends, I have a table in which there are thousands of records and in city field there is NULL value for all records now i want to change that null value with distinct values in each record say delhi, bihar, agra, jaipur etc, what will be the query for that????? its not possible to update thousands of records one by one. is there any alternative ...? Plz help ... its urgent Thanx in advance

1 Answers  






What is a sql join?

0 Answers  


What is cte (common table expression)?

0 Answers  


What is sql server schema compare? How we can compare two database schemas?

0 Answers  


How To Change Column Ordinal Position in SQL Server 2005 using Query i.e I Want To Add Column at Particular Ordinal Position in SQL Server 2005

2 Answers  


What is replication with database mirroring? : sql server database administration

0 Answers  


Which is faster statement or preparedstatement?

0 Answers  


how to implement locking in sql server

3 Answers   Satyam,


Categories