Difference between Stored Procedure and User Defined Function ?
UDF and STored Procedure UDF : Excutable from SQL,SELECT and SQL action queries SP :Use EXECUTE or EXEC to run UDF : Doesnt return output parameters SP : Supports output parameters UDF : Returns table variable SP : Can create a physical table and populate it, but cant return a table variable UDF : Can join to a UDF SP : Cant join to a SP UDF : Cant make permanent changes to the server environment or an external source SP : SP can be used to change some of the server environment and operiting environment UDF : Cant be used in an XML FOR clause SP : Can be used in an XML FOR clause UDF : T-SQL errors stops the function when an error occurs SP : Errors are ignored and T-SQL processes the next statement.