1) a) Stored Procedure may or may not return values. i.e if insert statements are present in the sp then it wont return anything. If select
statement is within sp then return a table.
b) A User Defined Function should return values
2) a) SP may have input and output parameters
b) UDF can have only input parameters
3) a) All DML operations can be done withing SP.
b) Only Select operation can be done in UDF
4) a) SP cannot be used with select/where/having cluases.
b) UDF can be used with select/where/having cluases.
5) a) SP can call a UDF
b) UDF cannot call a SP
6) a) SP can be run independently using EXEC
b) UDF cannot run independently
7) a) Temporary tables can be created in SP.
b) Temporary tables cannot be created in UDF.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.