O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying Stored Procedures

You can modify the text of a stored procedure by using the ALTER PROCEDURE statement. The syntax for ALTER PROCEDURE is similar to the syntax for CREATE PROCEDURE (see Listing 24.11). Using ALTER PROCEDURE has a couple advantages over dropping and re-creating a procedure to modify it. The main advantage is that you don’t have to drop the procedure first to make the change, so it remains available, even if the ALTER PROCEDURE command fails due to a syntax or object reference error. The second advantage is that because you don’t have to drop the procedure, you don’t have to worry about reassigning permissions to it after modifying it.

LISTING 24.11 Modifying a Stored Procedure by Using ALTER PROCEDURE

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required