Samir Bhogayta
Difference between Function and Stored Procedure?
By Samir Bhogayta in SQL Server on Jun 25 2016
  • Dennis Thomas
    Dec, 2017 28

    You can find good comparison over here: www.c-sharpcorner.com/article/stored-procedures-vs-user-defined-functions-and-choosing-which-one-to-use/

    • 0
  • sushil kumar
    Jul, 2017 8

    Stored Procedure :- 1.) Can take input \output parameter. 2.) can return zero,single or multiple rows. 3.) can use DML,DDl staements. 4.) can use non-deterministic function like getdate() 5.) use transaction 6.) use try-catch block 7.) use function inside stored procedureFunction : 1.) use only input parameter. 2.) must return a value. 3) use only DDL staement. 4.) cannot use try-catch block 5) cannot use transaction 6) cannot use stored procedure inside function

    • 0
  • Samir Bhogayta
    Jun, 2016 25

    UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be. UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables. Inline UDF’s can be though of as views that take parameters and can be used in JOINs and other Rowset operations.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS