A stored procedure (Stored Procedure) is a large database system in which a set of SQL statements to complete a specific function is compiled and stored in a database, and the user executes it by specifying the name of the stored procedure and giving the parameter (if the stored procedure has parameters).
The main difference between it and a user-defined function is that
A stored procedure is a collection of SQL statements that define a series of tasks that involve a particular table or other object, and the user can invoke the stored procedure. A function is a method that the database has defined that takes parameters and returns some type of value, and does not involve a specific user table.
Second said:
Functions (UDFs) can be applied like other expressions, and stored procedures can only be invoked through call or execute
Call procedure (...)
EXECUTE preocedure (...)
Three said:
A function is a subroutine used to do some calculations. Scalar functions return only one value (or NULL), the table function returns the relational table for several rows, and a number of column functions in each row must return a value (using the keyword), and the stored procedure does not enforce the requirement. Stored procedures can use return keywords, but do not require return value functions to be used in SELECT statements as long as they do not manipulate data. Stored procedures cannot be used in slelect statements. Functions have only in parameters, and stored procedures can have out or inout parameter stored procedures can return multiple values through an out parameter or return nothing