SQL-Server Performance: What is faster, a stored procedure or a view?

后端 未结 11 701
星月不相逢
星月不相逢 2020-12-04 23:53

What is faster in SQL Server 2005/2008, a Stored Procedure or a View?

EDIT: As many of you pointed out, I am being too vague. Let me attempt to

11条回答
  •  无人及你
    2020-12-05 00:39

    Views:

    • We can create index on views (not possible in stored proc)
    • it's easy to give abstract views(only limited column access of multiple table ) of table data to other DBA/users

    Store Procedure:

    • We can pass parameters to sp(not possible in views)
    • Execute multiple statement inside procedure (like insert, update,delete operations)

提交回复
热议问题