The ALTER PROCEDURE statement must include the entire new procedure. You can use PROC as a synonym for PROCEDURE.
Syntax 1
The ALTER PROCEDURE statement is identical in syntax to the CREATE PROCEDURE statement except for the first word. Both
Watcom and Transact-SQL dialect procedures can be altered through the use of ALTER PROCEDURE.
With ALTER PROCEDURE, existing permissions on the procedure are not changed. If you execute DROP PROCEDURE followed by CREATE
PROCEDURE, execute permissions are reassigned.
Syntax 2
Use SET HIDDEN to obfuscate the definition of the associated procedure and cause it to become unreadable. The procedure
can be unloaded and reloaded into other databases.
If SET HIDDEN is used, debugging using the debugger does not show the procedure definition, and the definition is not available
through procedure profiling.
You cannot combine Syntax 2 with Syntax 1.
Note
This setting is irreversible. It is recommended that you retain the original procedure definition outside of the database.
Syntax 3
Use the RECOMPILE syntax to recompile a stored procedure. When you recompile a procedure, the definition stored in the
catalog is re-parsed and the syntax is verified. For procedures that generate a result set but do not include a RESULT clause,
the database server attempts to determine the result set characteristics for the procedure and stores the information in the
catalog. This can be useful if a table referenced by the procedure has been altered to add, remove, or rename columns since
the procedure was created.
The procedure definition is not changed by recompiling. You can recompile procedures with definitions hidden with the SET
HIDDEN clause, but their definitions remain hidden.
SQL/2008
Vendor extension. ALTER PROCEDURE is optional SQL language feature F381 of the SQL/2008 standard. However, in the SQL
standard, ALTER PROCEDURE cannot be used to re-define a stored procedure definition, and Transact-SQL dialect procedures are
not supported. SQL/2008 does not include support for SET HIDDEN or RECOMPILE.