Home All Groups Group Topic Archive Search About

Copy SPROCs to different database

Author
19 May 2006 12:06 AM
scott
Is there a manual or code way to copy stored procedures from 1one sql db to
another without opening each one, copying, creating a new SPROC in target db
and pasting?

Can DTS accomplish this?

Author
19 May 2006 12:47 AM
MeanOldDBA
You can use DTS.  If you have enterprise manager, you can also just
right-click on a database and choose to import or export data.  When you get
into the wizard, choose to "Copy objects and data betwen SQL Server
databases".  You can then save this entire thing as a DTS package, which you
can manipulate, schedule, etc.


--
MeanOldDBA
derricklegg***@hotmail.com
http://weblogs.sqlteam.com/derrickl

When life gives you a lemon, fire the DBA.


Show quote
"scott" wrote:

> Is there a manual or code way to copy stored procedures from 1one sql db to
> another without opening each one, copying, creating a new SPROC in target db
> and pasting?
>
> Can DTS accomplish this?
>
>
>
Author
19 May 2006 12:47 AM
Andrew J. Kelly
You can use Enterprise Manager and right click on the db and choose "All
Tasks - Generate SQL Script".  Then choose all the sp's and you will get one
script for all the sps.  Just run that in the other db.

--
Andrew J. Kelly  SQL MVP


Show quote
"scott" <sbai***@mileslumber.com> wrote in message
news:e45c5eteGHA.5104@TK2MSFTNGP04.phx.gbl...
> Is there a manual or code way to copy stored procedures from 1one sql db
> to another without opening each one, copying, creating a new SPROC in
> target db and pasting?
>
> Can DTS accomplish this?
>
Author
19 May 2006 12:50 AM
Tim Dot NoSpam
You can use DTS to copy database objects from one database to another.

Are you using Sql Server 2000 or Sql Server 2005?  I think, if I rememer
correctly, there is a copy database or copy database objects task in 2000.
2005 makes it a whole lot easier.

-Tim

Show quote
"scott" <sbai***@mileslumber.com> wrote in message
news:e45c5eteGHA.5104@TK2MSFTNGP04.phx.gbl...
> Is there a manual or code way to copy stored procedures from 1one sql db
> to another without opening each one, copying, creating a new SPROC in
> target db and pasting?
>
> Can DTS accomplish this?
>

AddThis Social Bookmark Button