A stored procedure is a series of SQL statements compiled and saved to the database.
Stored procedures can be as simple or as complex as you like. However, one of the benefits of stored procedures is that they allow you to store complex scripts on the server.
Stored procedures often contain conditional programming such as IF... ELSE
statements for example. Stored procedures can also accept parameters.