Copying Stored Procedure Using SSMS

Using SSMS, is there a GUI method for copying a stored procedure from one DB to another DB (both on the same SQL Server instance)?  in other words, not using SQL code "Create stored procedure ..."
eeyoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
no there isn't. You need to create the script and run it from the other database.
0
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Not that I'm aware of, but just out of curiosity explain why you wish to do this via a GUI?

For a single SP, just script it out, change the database name, and re-execute.   Right-click > Script Stored Procedure As ... > Create To > New Query Editor Window.

For every SP in a database, open SQL Server Data Tools (2012 or greater), create a new SQL Server database project, and by using SQL menu > Schema Compare > New Schema Comparison... it is possible to point to two different databases, and execute all of the first database's objects, including SP's, into the second database.  Damn handy.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eeyoAuthor Commented:
Not that I'm aware of, but just out of curiosity explain why you wish to do this via a GUI?
I do it with scripting as you have suggested, but there is a client (with little SQL experience) who wants to copy the  stored procedures themselves.
0
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Understand, but we believe that Microsoft does not expose that functionality via a GUI, so Éric and I will declare dibs on 'You can't do that' as the correct answer here.

Also, not sure how sustainable 'want to copy the stored procedures themselves (via a GUI)' is, as almost all SQL Server developer and DBA classes in the last couple of years heavily emphasize scripting out T-SQL as opposed to using the GUI.   Reproduceble, schedulable, there's a host of reasons...
0
Éric MoreauSenior .Net ConsultantCommented:
>>but there is a client (with little SQL experience) who wants to copy the  stored procedures themselves.

if they are not good enough to script procedures, I wouldn't open that kind of modification to them. they can really scrap the database
0
eeyoAuthor Commented:
I agree with all of the above.  I just wanted to make sure there wasn't a feature is SSMS that I had been missing all these years.  Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.