Remove (merge) SQL Servers' database secondary data file -
I have a database backup for which SQL Server Management Studio says there are three files in it: a .mdf File
, a .ndf
file and a .ldf
file. This secondary data file ( .ndf
one) was not created for no apparent reason, so I want to delete it altogether (without losing data), during priority, while the database Being restored is backup
Is this all possible?
OK, get a solution
Back up the database first.
Execute it:
USE database_name;
Then execute it, and replace logical_ndf_file_name
with the logical name of your NDF file (which you can easily search through Database-> Properties_file ):
DBCC Shrink file ('logical_ff_name', AMPTIIEE); Remove the optional database database_name file logical_and_file_name;
Comments
Post a Comment