Solved

move Stored procedure

Posted on 2009-06-30
4
205 Views
Last Modified: 2012-08-14
I need to move Stored procedure ( about 80) from databse A to Database B...
i don't want to restore the database, only need to move SPs ..
what is the best way to do this?
0
Comment
Question by:jung1975
4 Comments
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 100 total points
ID: 24747789
right click on the sp  from enterprise manager  choose generate script, copy it , run it on the other database
0
 
LVL 37

Assisted Solution

by:momi_sabag
momi_sabag earned 100 total points
ID: 24747822
if its sql server 2005 you can use the managment studio to copy objects between databases
0
 
LVL 17

Accepted Solution

by:
pssandhu earned 200 total points
ID: 24747879
You can run this command to generate the scripts for the stored procedure all at once and copy the results in SSMS query editore window and run all the create procedure scripts at once.

SELECT ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE'
P.
0
 
LVL 42

Assisted Solution

by:Eugene Z
Eugene Z earned 100 total points
ID: 24748057
script them from EM\SSMS -copy - paste them to their new home (sql server DB) and execute
Check errors and fix them if you get any
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question