We help IT Professionals succeed at work.

SQL Server 2005 - Modifying a Stored Procedure

feesu
feesu asked
on
Hi Experts,
I am using SQL 2005, and I need to modify one of existing stored procedures. How do I do that?
Whenever I try to edit and save, it saves it as an external file!
Comment
Watch Question

Database Consultant
BRONZE EXPERT
Top Expert 2009
Commented:
Hello feesu,

dont have to save it, just press F5 after urediting is over


Aneesh R

Commented:
In Management Studio open a new query window. Write:

USE <YourDatabaseName>
GO

EXEC sp_helptext <YourProcedureName>
GO

Then just copy the result (your procedure definition) into a new query window, replace word "CREATE" with "ALTER", change procedure body or whatever you need, make sure that you are using the proper database and execute the script.
David ToddSenior Database Administrator
BRONZE EXPERT

Commented:
Hi,

If you have an if exists ... drop ... create ... script, yes save sill save an external file.

You need to execute the query.

HTH
  David

Explore More ContentExplore courses, solutions, and other research materials related to this topic.