Solved

Multiple files within the primary file group

Posted on 2008-10-19
3
415 Views
Last Modified: 2012-06-22
Hi All,

Is it possible to take a backup of a database that has multiple files within the primary file group (2 total in this example)

and restore that backup to a new database that has only one file in the primary file group?

Note I am talking about 2 FILES in 1 Filegroup not Multipule file groups!

This is on SQL 2000
0
Comment
Question by:TAB8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22753645
no. the restore will restore the same files as in the original database as it was backed up.
0
 
LVL 10

Author Comment

by:TAB8
ID: 22753706
How can I then after the restore combine the two files into one file ..

Do i have to create a new secondary filegroup with a seperate file
Move all  object to the new file group
Make the new file group the primary
then remove the old file group with the 2 empty files

THis just seems like a long process for a simple taks ?
 
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22753822
that scenario would work, but not for the PRIMARY filegroup which cannot be deleted/renamed.

what you need to do is use the DBCC SHRINKFILE command with the EMPTYFILE option.
that will move all the data from that file to the other file(s) of it's filegroup, and after that you can drop the file.

msdn.microsoft.com/en-us/library/ms189493.aspx
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question