Last answered:

03 Oct 2022

Posted on:

02 Oct 2022


views vs procedure

HI, what is the practical difference between views and procedues? but that i mean that both serve as a shorcut to the select statment.. thanks..

1 answers ( 0 marked as helpful)
Posted on:

03 Oct 2022


Hi Kfir!
Thanks for reaching out.

A view is intended to be regarded similarly to a table, it gives an overview of combination of data from different tables. A routine can also include different operations than just reading data, it could also be used for other CRUD operations like insertion, updating or deleting data. You cannot do that with a view.  A view represents a virtual table. You can join multiple tables in a view and use the view to present the data as if the data were coming from a single table.
A stored procedure uses parameters to do a function - for example a calculation. It can be updating and inserting data, or returning single values or data sets.

Hope this helps.

Submit an answer