Question : Merge to SQL Server Data Files

I have a SQL Server database that has two data files (mdf + ndf). I really don't need the two. However, I don't know how to merge the one into the other. Can someone please explain how to do this or point me in the right direction?

Answer : Merge to SQL Server Data Files

to merge:
* if the 2 datafiles are in the same filegroup (PRIMARY): use this: DBCC SHRINKFILE WITH EMPTYFILE, after that, you should be able to drop the datafile from the database
* if the 2 datafiles are of different filegroups, move all the tables and indexes to the primary filegroup, then you can drop the datafile.

if you don't know how to move tables/indexes from a filegroup to another, check out google, it's easy to find.
Random Solutions  
 
programming4us programming4us