tags:

views:

169

answers:

2

I want to extract a subset of a database and copy to another server/database. Is it possible to copy/backup a single filegroup from one database and attach/restore to another?

A: 

Use the faithful "SELECT * FROM old_db.old_tbl INTO new_db.new_tbl" for each table.

Randolph Potter
A: 

You cannot restore a filegroup into a different database. Any restore operation must go through the recovery phase when the log is replayed against the restored data files and a new database would have a log that does not match the restored filgroup, so the engine will reject the backup.

You cannot detach/attach filegroups either, detach and attach are not working at filegroup level, only at database level.

Nor can you cannot do a file copy/overwrite, when the database comes online the recovery process will detect the mismatch and declare the database corrupt.

Remus Rusanu
Not the answer I was hoping for but very helpful.
Mathias