Stored Procedures Vs. Views

前端 未结 7 1457
难免孤独
难免孤独 2020-12-07 16:26

I have used both but what I am not clear is when I should prefer one over the other. I mean I know stored procedure can take in parameters...but really we can still perform

7条回答
  •  半阙折子戏
    2020-12-07 16:58

    The advantage of views is that they can be treated just like tables. You can use WHERE to get filtered data from them, JOIN into them, et cetera. You can even INSERT data into them if they're simple enough. Views also allow you to index their results, unlike stored procedures.

提交回复
热议问题