Solved

Multiple files within the primary file group

Posted on 2008-10-19
3
412 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
  • 2
3 Comments
 
LVL 142

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 142

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now