Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Is it possible to copy SP from one Db to another

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2009-03-13 : 23:25:13
Is it possible to copy SP's from one DB to another on the same server, via SQL commands / queries..

I have 8 identical databases on the same server, i would like to copy the sp's using sql commands via query analyzer.

db1.dbo.USP_MyOrdersSP1 to database db2..

Thank you very much for the helpful info.

sridhar.dbe
Starting Member

34 Posts

Posted - 2009-03-14 : 03:04:03
In Management studio,Right-click on source database>Tasks>Generate Script>

Select the source table, select Stored Procedures, then check the required stored procedures, finally save it in a single file with a .sql extension.

Open the file, rename the database to target database name, and execute it on target database.


isk
Go to Top of Page
   

- Advertisement -