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
 General SQL Server Forums
 New to SQL Server Programming
 stored procedures

Author  Topic 

mdean9999
Starting Member

21 Posts

Posted - 2011-06-08 : 08:38:06
Thanks for all the help so far with me trying to be a dbadmin!!
I have a number of stored procedures online which I would like to backup on my local copy of sql server 2008.
How do I copy stored procedures from one database to another.
michael



khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-06-08 : 08:46:53
use SQL Server Management Studio, navigate to the stored procedure. right click to script it out to file and back it up.

You should keep your stored procedure in file rather than in the database. It is easier for future deployment to a different server or database.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-06-08 : 08:48:23
If you are using 2005 or higher
Then open your object explorer right click on your database
click to Tasks
and click to Generate Scripts
it opens new window click on next
and select your database and click next
and again next
Select Stored Procedure check box click next
and select all check box
click next, next and finish
It generates scripts on your query window

In Love... With Me!
Go to Top of Page
   

- Advertisement -