20 June 2013

Difference between a stored procedure and a view

stored procedure:
  • accepts parameters
  • can NOT be used as building block in a larger query
  • can contain several statements, loops, IF ELSE, etc.
  • can perform modifications to one or several tables
  • can NOT be used as the target of an INSERT, UPDATE or DELETE statement.
 view:
  • does NOT accept parameters
  • can be used as building block in a larger query
  • can contain only one single SELECT query
  • can NOT perform modifications to any table
  • but can (sometimes) be used as the target of an INSERT, UPDATE or DELETE statement.

No comments:

Post a Comment