0 pts.
 Filegroups in SQL Server
I have created many filegroups for each of my databases in SQL Server. Now I am moving to a different server.I have backed up all the databases of this existing server of mine. If I delete these filegroups then will I be able to recover these backed up databases? Or do I need to backup these files and filegroups as well? Pls. help as these filegroups are taking a lot of spaces. I have shrinked them as far as possible.

Software/Hardware used:
ASKED: February 21, 2006  9:46 AM
UPDATED: February 22, 2006  7:59 PM

Answer Wiki:
Make sure you have truly shrink the files with DBCC SHRINKFILE (gm_data, 25600) When you recover a SQL database you'll find it will always create the same files, that's not to say you can't change the file paths. The best way to eliminate unwanted files and filegroups, is to: - create a new database with the desired files and filegroups. - create the tables without any Primary Keys, indexs, or other constraints. - Then insert the data in each table by writting a select statements. - then add back the remaining database objects. You can use SQL's scripting ability to generate scripts, but this will require some editing on your part. I've frequently edited scripts to control where tables and indexes will be creates. Note all stored procedures, triggers, and functions will be stored on the default filegroup. I will typically edit scripts to seperate them by database object, i.e. tables only, then primary keys, indexes, other constraints like foreign keys and check constraints, stored procedures, triggers, functions, database roles, grants, etc. I know this is a lot of work, but the final result will be you know where every object is stored in your database and you won't run into a table being stored across three different files on one or more logical drives.
Last Wiki Answer Submitted:  February 22, 2006  7:59 pm  by  Deba13   0 pts.
All Answer Wiki Contributors:  Deba13   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _