Monday, February 13, 2012

Copy Stored proc from one DB to other

Hi All,
I want to copy my stored proc from one DB to other. I am wondering how
can I do it??Can I use DTS to do that?I couldn't find option in to
do it in DTS?
Thanks!
One method is to use a DTS 'Copy SQL Server Objects' task. For a single
stored proc, you might find it faster to script the object in Query Analyzer
and then run the script in the target database.
You might also consider keeping scripts for all of your objects (preferably
under source control). You can then use these scripts to promote database
changes for testing or production.
Hope this helps.
Dan Guzman
SQL Server MVP
"Sheryl" <kiranpannu@.gmail.com> wrote in message
news:1165647570.822429.269540@.16g2000cwy.googlegro ups.com...
> Hi All,
> I want to copy my stored proc from one DB to other. I am wondering how
> can I do it??Can I use DTS to do that?I couldn't find option in to
> do it in DTS?
>
> Thanks!
>
|||Hello,
In the source sql server .. open enterprise manager.. Select database ..
right click-- all tasks-- Generate SQL Scripts...
choose all objects , Select all procedures -- permissions...Script it as a
SQL file. Then you could use this script to create procedures
in destination sql server.
Thanks
Hari
"Sheryl" <kiranpannu@.gmail.com> wrote in message
news:1165647570.822429.269540@.16g2000cwy.googlegro ups.com...
> Hi All,
> I want to copy my stored proc from one DB to other. I am wondering how
> can I do it??Can I use DTS to do that?I couldn't find option in to
> do it in DTS?
>
> Thanks!
>
|||Thanks it worked!!!!
Hari Prasad wrote:[vbcol=seagreen]
> Hello,
> In the source sql server .. open enterprise manager.. Select database ..
> right click-- all tasks-- Generate SQL Scripts...
> choose all objects , Select all procedures -- permissions...Script it as a
> SQL file. Then you could use this script to create procedures
> in destination sql server.
> Thanks
> Hari
> "Sheryl" <kiranpannu@.gmail.com> wrote in message
> news:1165647570.822429.269540@.16g2000cwy.googlegro ups.com...
|||Thanks very much!!!!!!!
Dan Guzman wrote:[vbcol=seagreen]
> One method is to use a DTS 'Copy SQL Server Objects' task. For a single
> stored proc, you might find it faster to script the object in Query Analyzer
> and then run the script in the target database.
> You might also consider keeping scripts for all of your objects (preferably
> under source control). You can then use these scripts to promote database
> changes for testing or production.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Sheryl" <kiranpannu@.gmail.com> wrote in message
> news:1165647570.822429.269540@.16g2000cwy.googlegro ups.com...

No comments:

Post a Comment