Move all tables from a .ndf file to the .mdf file and eliminate the .ndf file

Move all tables from a .ndf file to the .mdf file and eliminate the .ndf file

Post by Jae » Fri, 06 Sep 2002 06:19:57



I have two files in the Primary file group, x.mdf and
x.ndf in a user database.  I want to move the contents of
the x.ndf file to the x.mdf file and eliminate the x.ndf
file.  

Thank you in advance for any light that you can shed on
this problem.

jdh

 
 
 

Move all tables from a .ndf file to the .mdf file and eliminate the .ndf file

Post by lindawi » Fri, 06 Sep 2002 07:02:59


Jae,

Quote:> I have two files in the Primary file group, x.mdf and
> x.ndf in a user database.  I want to move the contents of
> the x.ndf file to the x.mdf file and eliminate the x.ndf
> file.

Use dbcc shrinkfile (logical_filename, emptyfile)
to move the contents to the .ndf file to the .mdf file.
Then use alter database ... remove file.
Refer to Books Online for syntax details.

Linda

 
 
 

Move all tables from a .ndf file to the .mdf file and eliminate the .ndf file

Post by Jae » Sat, 07 Sep 2002 23:16:34


Linda,
Thank you.  

jdh

Quote:>-----Original Message-----
>Jae,

>> I have two files in the Primary file group, x.mdf and
>> x.ndf in a user database.  I want to move the contents
of
>> the x.ndf file to the x.mdf file and eliminate the x.ndf
>> file.

>Use dbcc shrinkfile (logical_filename, emptyfile)
>to move the contents to the .ndf file to the .mdf file.
>Then use alter database ... remove file.
>Refer to Books Online for syntax details.

>Linda

>.

 
 
 

1. clone database from 1 mdf file to multiple .mdf files (.mdf and .ndf)

I need to replicate a 26GB database.  The source database has only 1
logical name and 1 physical file (26GB .mdf file).  Unfortunately, on
my target server I don't have one big file system.  I manage to
combine space by create a new database with multiple files.  But
restore fails because I don't have the same file configuration.  Has
any one successfuly done this type of clone?
I'd love to hear a different approach.
Thanks
Kim

2. WORK WANTED - Filemaker

3. Attach MDF/NDF files with a missing LDF file

4. PTS Solution

5. Import Detached SQL 7.0 MDF and NDF files to SQL 2k

6. TQuery 'live' data sets

7. Merging MDF/NDF Database Files

8. Problem converting SELECT with embedded SELECTs

9. Performance gains from creating .MDF and multiple .NDF files

10. Restoring database from .mdf, .ldf and .ndf files in sql 7

11. distributing db into seperate .mdf and .ndf files

12. Copying live mdf/ndf/ldf files

13. Combining mdf and ndf files into one.