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 2000 Forums
 SQL Server Administration (2000)
 copying stored procedures between databases

Author  Topic 

tribune
Posting Yak Master

105 Posts

Posted - 2005-03-15 : 14:51:17
Is there an easy way to copy several sprocs from one database to another using enterprise manager? Like copying data tables using the import wizard?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-03-15 : 14:53:56
Yes, highlight them, right click, all tasks, generate SQL script. Then run that script on the destination database.

Tara
Go to Top of Page

tribune
Posting Yak Master

105 Posts

Posted - 2005-03-15 : 16:21:52
thanks!
Go to Top of Page

PW
Yak Posting Veteran

95 Posts

Posted - 2005-03-15 : 16:30:22
Note, if this is a recurring task that you need to re-run periodically, you can create a DTS package to automate it.

Open a new DTS package and add a "Copy SQL Server Objects Task" to it. Then open that object and fill in the property sheets to specify what objects you want to copy & the behaviour you want.

You can now manually run this package as required, or schedule it to run as required.
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-03-15 : 19:03:21
Better still, keep all your stored procs in script files in source control. That way you get proper versioning on your procs, and it's trivial to deploy them all anywhere.


Damian
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-15 : 21:45:40
Case in point:

http://weblogs.sqlteam.com/robv/articles/4099.aspx
http://weblogs.sqlteam.com/robv/articles/4102.aspx
Go to Top of Page
   

- Advertisement -