Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to unsplit a database

Author  Topic 

websitewill
Starting Member

1 Post

Posted - 2007-03-30 : 09:52:08
Hello all,

I have a database on a SQL Server 2000 instance that is spread across two hard drives. This split was because of the size of the available drives at the time the database was created and not for any real performance gains (though they may have happened).

We now have a SQL 2005 box that we configured with tons of storage space and would like the database to reside in one file on the single hard drive. I know I can restore the database to a single disk with multiple files but what I want is to have a single data file on the single database. How do I go about getting rid of the dependency on the second file.

To sum it up, I am currently restoring the database to
D:\MSSQL\Data\MyData.mdf
D:\MSSQL\Data\MyData_Extra.mdf
and I would like to get the database to simply reside on
D:\MSSQL\Data\MyData.mdf

Is this possible in SQL Server 2005, sp2?

I am guessing the same solution will also work for the split log files?

Thanks,
Will

nr
SQLTeam MVY

12543 Posts

Posted - 2007-03-30 : 10:54:38
You need to empty the file then you can remove it.
Look at the shrink file task in management studio.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -