When a CREATE PROCEDURE statement is successfully executed, the procedure's name is stored in the sysobjects system table, its normalized plan in sysprocedures, and the text of the CREATE PROCEDURE statement in syscomments. When executed for the first time, the procedure is compiled to determine an optimal access plan to retrieve the data.
A stored procedure can be run by issuing the EXECUTE statement along with the procedure's name and any parameters. Parameters supplied in the format of @parameter = value can be supplied in any order; however, if you supply one parameter in the form @parameter = value, you must supply all subsequent parameters this way. If you do not supply parameters in the form @parameter = value, you must supply them in the order given in the CREATE PROCEDURE statement. Although you can omit parameters for which defaults have been supplied, you cannot skip any ¾ that is, if a procedure has five parameters, you can omit both the fourth and the fifth parameters, but you cannot skip the fourth and still include the fifth.
If a procedure is the first statement in a batch, you can give its name without using the EXECUTE keyword. When a procedure is executed successfully, the global variable @@ERROR is set to 0.