How to delete ndf?

My DBA asked me this question. This is very important in some cases. My DBA created an .ndf in some drive where he shouldn’t have created. Then later he informed me. I asked him to delete .ndf and he tried to delete this in the same manner you delete any notepad document. This will never work as the file is being used. :).

Following is the way to delete this file. Fairely easy.

DBCC SHRINKFILE (LogicalNAME, EMPTYFILE).

ALTER DATABASE MYDB
REMOVE FILE ‘Logical_FIle_Name’ ;

Please write me if you have any questions.

Regards,
Online MSSQL Classes @ http://tuitionaffordable.webstarts.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s