2/20/2007

Difference between Stored Procedure and Function (UDF)

Functions


  • can be used with Select statement

  • Not returning output parameter but returns Table variables

  • You can join UDF

  • Can not be used to change server configuration

  • Can not be used with XML FOR clause

  • Can not have transaction within function



Stored Procedure

  • have to use EXEC or EXECUTE

  • return output parameter

  • can create table but won’t return Table Variables

  • you can not join SP

  • can be used to change server configuration

  • can be used with XML FOR Clause

  • can have transaction within SP

Reactions:

7 comments:

  1. Thank you. This was very helpful.

    ReplyDelete
  2. its seems to be very simple

    ReplyDelete
  3. Thanxs A Lot for Giving your valuable time...

    ReplyDelete
  4. 20 main differences between Stored procedures and Functions in Sql Server
    http://www.webcodeexpert.com/2013/04/difference-between-stored-procedures.html

    ReplyDelete

I appreciate your time, thanks for posting your comment. I will review and reply to your comment as soon as I can.

Thank you
Hemantgiri