Copy SP From one DB to Other DB

Posted by Sathya4260 under Sql Server on 2/7/2011 | Points: 10 | Views : 1700 | Status : [Member] | Replies : 5
Hi,

Can anyone tell the easy way to copy the stored procedure from one DB to other Database:

Currently i am using Create to --> Use new window -->select new DB in drop down -->Execute...

Sathish Kumar S


Responses

Posted by: PandianS on: 2/7/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi

- Prepare the script from source Database(with IF EXISTS....).
- Deploy it on Destination DB/Server.

Cheers
www.sqlserverbuddy.blogspot.com


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 2/7/2011 [Member] Starter | Points: 25

Up
0
Down
I cant able to get u pandian, Can you explain me clearly...


Sathish Kumar S

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/7/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

If you are using Visual studio 2010 its very simple to do that using the IDE itself.

Else as pandian mentioned... you need to prepare the script like

go to query analyser and type
Sp_helptext Stored procedurename
then u will get the script... Copy and paste in the destination server and hit F5... you are done

Thanks
Karthik
www.f5Debug.net

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Skraghava on: 2/7/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

Better solution to move all the scripts at a time will be, Generate the script.(Right click on DB -->Tasks->Generate Scripts--> Select the objects which you required and save to a file.. then you can execute all the SP's at a time..



Thanks and regards,
Raghavendra SK

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Check this artcile... you can use VS 2010 to copy the missing objects from one DB to other in simple steps

http://www.dotnetfunda.com/articles/article1121-sql-server-schema-comparison-tool-in-visual-studio-2010-.aspx

Thanks
Karthik
www.f5Debug.net

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response