SQL Server Performance Forum – Threads Archive
Filegroups and filesApologies if this is a silly suggestion.
If I have two databases one made up of multiple files and filegroups is there any method of backing up, detaching or whatever and attaching/restoring them to the second database. The reason I want to do this is because I have a bunch of historical tables in one database with many millions of rows in them and I would like to attach somehow the rest of the tables from another database to it to make it into one database. Thanks for any suggestions.
ON that first database are these tables stored on a different filegroup or all in one PRIMARY filegroup? Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
This posting is provided â€œAS ISâ€ with no rights for the sake of knowledge sharing.
Thanks for the reply. thay are stored in a different filegroup.
I have database T1 with Primary and F2 filegroups. F2 has a table in it. I also have T2 database with Primary and F2 filegroups. F2 has no tables in it. What I want to do is some how apply the contents of T1 F2 filegroup againt T2. Is this possible?
I tried backing up T1 F2 filegroup and restoring this against T2 and got the following error: RESTORE DATABASE [T2] FILE = N’T2′ FROM DISK = N’Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupT1.bak’ WITH FILE = 1, NOUNLOAD, STATS = 10
GO Msg 3154, Level 16, State 4, Line 1
The backup set holds a backup of a database other than the existing ‘T2’ database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally. thanks for your continued support.
i do not think you can detach or backup a filegroup from one database, then restore on another database, but you might give it a try,
on the target db, try creating the file group first, then restore the backup if this does not work, send this as a feature request to [email protected],
it does sound like a reasonable feature request