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.
| Author |
Topic |
|
Torch
Starting Member
20 Posts |
Posted - 2005-07-13 : 21:36:04
|
| Can someone tell me how I would write a stored procedure that backs up and restores a database on the same server?Torch. |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-07-14 : 00:31:25
|
| Have a look at Tara's Bloghttp://weblogs.sqlteam.com/tarad/category/95.aspxor you could use the Backup Maintenance tools in Enterprise ManagerOr are you just trying to copy a database to a new name as a one-off task?Kristen |
 |
|
|
Torch
Starting Member
20 Posts |
Posted - 2005-07-14 : 04:21:48
|
| I need to put it into a stored procedure as it will be done through an application a large numer of times.Torch. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-07-14 : 11:31:48
|
| Tara's blog has a good worked example of how to do regular backups using Sprocs; it contains all the "moves" for an equivalent home-brew SProc.Having said that the BACKUP and RESTORE commands have trillions of options depending on what you want to do - split various tables into different filegroups spread across multiple drive systems for performance; restore to a different phsyical location to the original database backup. That sort of stuff.Might be an idea to explain in more detail what problem you are trying to solve - someone here will probably have the makings of a solution already built, or failing that a bunch of "suggestions"!Kristen |
 |
|
|
|
|
|