December 2013
Intermediate to advanced
1872 pages
153h 31m
English
To execute a stored procedure, you simply invoke it by using its name (the same way you probably have already executed system stored procedures, such as sp_help). If the execution of the stored procedure isn’t the first statement in a batch, you need to precede the procedure name with the EXEC keyword. Following is the basic syntax for executing stored procedures:
[EXEC[UTE]] [@status =] [schema].procedure_name[; number] [[@param_name =] expression [output][, ... ]][WITH RECOMPILE | { RESULT SETS UNDEFINED } | { RESULT SETS NONE } | { RESULT SETS ( <result_sets_definition> [,...n ] ) }]
Note
The reason you need the EXEC keyword when invoking a stored procedure in a batch or ...