Dragon in the sky

whatever happened , go ahead! Happy life of big pig and its dog.
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

存储过程和函数的区别

Posted on 2009-09-28 15:15  龙泰  阅读(148)  评论(0编辑  收藏  举报

 

  1. Procedure can return zero or n values whereas function can return one value which is mandatory.
  2. Procedures can have input,output parameters for it whereas functions can have only input parameters.
  3. Procedure allow select as well as DML statement in it whereas function allow only select statement in it.
  4. Functions can be called from procedure whereas procedures cannot be called from function.
  5. Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
  6. We can go for transaction management in procedure whereas we can't go in function.
  7. Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
  8. UDF Cannot execute dynamic SQL.