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 |
mojo1979
Starting Member
3 Posts |
Posted - 2011-11-10 : 13:53:41
|
Hi,I have around 100 db's attached to my SQL 2008 server. I want to detach around 50 of these and archive them onto a file share. I obviously don't want to do one at a time and would prefer to script it somehow.All 50 databases are located in the same folder - i.e 2009-01.Any help would be appreciated.Cheers |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-11-10 : 14:36:09
|
Why not just save your backups? You ARE taking backups right? |
 |
|
mojo1979
Starting Member
3 Posts |
Posted - 2011-11-10 : 14:42:30
|
Yes dbs are backed up to disk every night via HP data protector (backups which i dont have easy access to - another team in another country deals with that).I want to move these dbs to free up disk space as a quick and easy solution to a disk space problem. |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-11-10 : 15:00:36
|
You want to move them to a remote file server and bring them back online?Not a good idea, and not possible by defualt, though there is a trace flaf you can use to override the default behavior.You can query sys.master_files to automate your detach script.If you just want to archive 'em, take backups (preferrably with compression), archive the backups and drop the database. |
 |
|
mojo1979
Starting Member
3 Posts |
Posted - 2011-11-10 : 15:09:51
|
The dbs won't be brought back online, they'll stay detached.I'll take a look at sys.master_files.Thanks |
 |
|
|
|
|