• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Steps to copying an Existing Stored Procedure and saving the copy back to the SP list in Microsoft SQL Server Management Studio

Cannot seem to get the SP's I am modifying to save in the Object Explorer List on the left of the SQL SERVER Mngt Studio 2008.

Here is the code I put in what am I doing wrong.
original code:
ALTER PROCEDURE [dbo].[Rpt_SalesSummaryAdopted_sproc]
What I do with the code
CREATE PROCEDURE [dbo].[Rpt_SalesSummaryAdopted_sproc_RB]

Then I go over to the file section and chose save as ???.SQL then I close the SQL SERVER Mngt Studio 2008 and upon reopen still no new copy of the code I want to work with....?
Can anyone layout the steps........please.
Fletcher Burdine
Fletcher Burdine
3 Solutions
Eugene ZCommented:
make sure the create proc ran in the right db

you need to execute the "create proc"
to insure it
add to query:

use yourDB
create proc
after you run create proc
and there are no errors
- if you wish to see it in GUI:
 right click on DB  (proc) - refresh and check

also you may just check from

use yourdb
select * from sysobjects where name ='Rpt_SalesSummaryAdopted_sproc_RB'
Eugene ZCommented:

How to: Modify a Stored Procedure (SQL Server Management Studio)http://technet.microsoft.com/en-us/library/ms345356(v=sql.105).aspx

How to: Create a Stored Procedure (SQL Server Management Studio)

just in case
How to: Rename a Stored Procedure (SQL Server Management Studio)
Remember to do a refresh on the server node in SSMS to see the sp in the procedures list.
Beth KludtIndependent Business OwnerCommented:
It sounds like you are creating a script that will create you new sp but then instead of running the script you just save the script (Then I go over to the file section and chose save as ???.SQL ).  You probably entered a file name in the "save as" dialog.  
Open the script back up in Management Studio (File\Open\File) and execute the script.  This will create your new stored proc.
Fletcher BurdineTableau Trainer & Consultant Sales Exec.Author Commented:
Thank you for the help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now