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

后端 未结 10 1971
星月不相逢
星月不相逢 2020-12-04 04:59

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 whe

10条回答
  •  广开言路
    2020-12-04 05:30

    Main difference is that when you are querying a view then it's definition is pasted into your query. Procedure could also give results of query, but it is compiled and for so faster. Another option are indexed views..

提交回复
热议问题