Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Moving existing Data file to different FileGroup

I currently have a database where the 1st data file is in one filegroup and the other 8 files are in a second filegroup.  I want to move the 1st file into the secondary filegroup.  Some basic directions would be appreciated.

0
blberger
Asked:
blberger
  • 2
1 Solution
 
Ephraim WangoyaCommented:
Easiest way to do so is to detach database, move file, then re-attach
 
0
 
blbergerAuthor Commented:
Not physically moving the datafile. The primary datafile (.mdf) is in a different firlegroup than the other datafiles (ldf).  I need to move the primary file into the same filegroup as the others and not move the datafile from drive to drive.
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> I want to move the 1st file into the secondary filegroup.  Some basic directions would be appreciated.

From BOL,
"The primary filegroup contains the primary data file and any other files not specifically assigned to another filegroup. All pages for the system tables are allocated in the primary filegroup."

So you can't move primary data file *.mdf from Primary filegroup and place it in another filegroup.
Instead You can move your other files from user created filegroup to Primary filegroup itself
0
 
blbergerAuthor Commented:
I guess that I was just being stubborn and wnated to keep the other filegroup instead.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now