How to: Modify a Stored Procedure (SQL Server Management Studio)
This topic describes how to modify a Transact-SQL stored procedure by using Object Explorer in SQL Server Management Studio. When you change the statements or parameters in a stored procedure by using this method, the permissions that have been defined for the stored procedure are retained, and any dependent stored procedures or triggers are not affected.
|Changing the name or definition of a stored procedure can cause dependent objects to fail if the dependent objects are not updated to reflect the changes that have been made to the stored procedure. For more information, see How to: View the Dependencies of a Stored Procedure (SQL Server Management Studio).|
In Object Explorer, connect to an instance of SQL Server 2005 Database Engine and then expand that instance.
Expand Databases, expand the database in which the stored procedure belongs, and then expand Programmability.
Expand Stored Procedures, right-click the procedure to modify, and then click Design.
Modify the text of the stored procedure.
To test the syntax, on the Query menu, click Parse.
To modify the stored procedure, on the Query menu, click Execute.
To save the script, on the File menu, click Save. Accept the file name or replace it with a new name, and then click Save.
|Validate all user input. Do not concatenate user input before you validate it. Never execute a command constructed from unvalidated user input. For more information, see SQL Injection.|
TasksHow to: Use Templates in SQL Server Management Studio
How to: Create a Stored Procedure (SQL Server Management Studio)
How to: Delete a Stored Procedure (SQL Server Management Studio)
How to: View the Dependencies of a Stored Procedure (SQL Server Management Studio)
How to: Rename a Stored Procedure (SQL Server Management Studio)
ConceptsModifying Stored Procedures
Other ResourcesALTER PROCEDURE (Transact-SQL)
Stored Procedure How-to Topics