Differences between functions and stored procedures?

Answer Posted / avinash

1. Functions can used with Select statement
SP are not
2. If we have a syntax error or bug in SP it ignore it at
execution. In case of Function it won't.
3. Function should return atlease one value.
SP may or maynot return values.
4. Function cannot include in other function.
We can execute one SP in other.

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the user of Primary key?

581


Can a table have 2 primary keys?

515


What is multi-statement table-value user-defined function?

543


how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?

1106


Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?

557






Explain the collation?

632


What do you think of this implementation? Can this be implemented better?

537


What is the difference between varchar and varchar types?

568


Can we perform backup restore operation on tempdb?

571


What are transactions in sql?

558


What does it mean to normalize a database and why would you do it?

532


How optimize sql query with multiple joins in sql server?

417


how many type of indexing in database?

585


how to invoke a trigger on demand? : Sql server database administration

569


What is lock escalation? : sql server database administration

599