difference between stored procedure and function
There can be a lot of differences between a UDF and stored procedure, as the prior link has shown. Another difference is the UDF can be directly selected from, whereas a stored procedure requires one to insert the results into a tempory table or table variable.
Differences between Stored procedure and User defined functions. UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.