What is the difference between a stored procedure and a view?

I am confused about a few points:

  1. What is the difference between a stored procedure and a view?

  2. When should I use stored procedures, and when should I use views, in SQL Server?

  3. Do views allow the creation of dynamic queries where we can pass parameters?

  4. Which one is the fastest, and on what basis is one faster than the other?

  5. Do views or stored procedures allocate memory permanently?

  6. What does it mean if someone says that views create a virtual table, while procedures create a materials table?

Please let me know about more points, if there are any.

10 Answers
10

Leave a Comment