Following are the main differences between Stored procedure and Function in SQL.
Stored Procedure | Function |
---|---|
Stored procedure may or may not return values | A Function must return a value |
Stored procedures can have input/output parameters | Functions can have only input parameters |
Stored Procedure may take 0 to n input parameters | For a Function it is mandatory to take one input parameter |