Functions (UDF) | Stored Procedures (SP) |
Execute Functions thru SQL Statement | It Can not be used in SQL Statements |
UDF run thru SQL SELECT | SP run thru EXECUTE OR EXEC |
You can't use DDL, DML statements in UDF | It is possible in SP |
It always return values | It May or May not return value |
UDF return single resultset | SP can return multiple resultset |
Function can't return XML output | SP can return XML output |
UDF can have only Input Parameter | SP can have Input & Output Parameter |
SP can not call thru Functions | Function can be called from SP |
Exception handling is not Possible | Exception Handling is possible |
Search this blog
Tuesday, June 29, 2010
Functions (UDF) Vs Stored Procedures (SP)
Labels:
SQL,
SQL Server
Subscribe to:
Post Comments (Atom)
Nice comparision.......
ReplyDelete