Consolidating 2 data files into 1

  • I had a database was outgrowing its disk space, so I altered the database to add a second data file on another drive. I have deleted a bunch of data out of the database, and now have enough space on the initial data file to hold all of the database data.  However, I still have some data in the second file allocation.  Is there an easy way to move that data to the first file allocation, so that I can drop the second file allocation?

    Thanks in advance for you help on this.

  • Are they on same file group? If yes then just empty the file and then you can delete that.

    to empty file goto EM--all tasks--shrink database--files--select datafile--select the option to empty the file.

    Hope this will help.

  • Yes they are on the same filegroup.  Now I see the EMPTYFILE option in BOL in DBCC SHRINKFILE.  Thanks!!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply