Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL2005 - Modifying Stored Procedure 1

Status
Not open for further replies.

CarolCook

IS-IT--Management
Mar 7, 2003
158
US
Simple question: I am trying to replace the code of an existing stored procedure with different code. The new code was sent to me in the form of a query. When I right click the Stored Procedure in Progammability and hit Modify, I see the existing code but it shows up as a new query. I can paste the new query over it but am stuck on how to get that to be saved over the existing stored procedure.
Thanks in advance.
 
Just executed and saved and it replaced it. Is it necessary to save?
 
You don't have to use any save menus or buttons. When you type CREATE PROCEDURE, you are telling SQL Server that you are creating a new stored procedure and giving it the name and definition of the stored procedure (usually a query or queries). When you type ALTER PROCEDURE you are telling SQL Server to overwrite the definition of the stored procedure. The only thing to save would be a copy of the old definition if you still have that--just in case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top