Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Please go easy it’s a steep learn curve..

OK steps done so far

  1. Create files,
  2. Create file groups,
  3. Create partition function,
  4. Create partition scheme,
  5. Partition table associate files with filegroups
  6. Put data in the table.

All is good

Now to reverse

The drop data

  1. Drop the partition and associations,
  2. Drop partition scheme,
  3. Drop partition function,
  4. Drop file groups

But when I deleted the files from the folder in my SSMS, I than had problems validating my Databases.

I restored the files and SSMS is fine.

My question what is the correct process for deleting .ndf and .ldf files?

share|improve this question
    
Describe more specifically what do you mean by "had problems validating my Databases". –  Petr Abdulin Jun 20 '11 at 8:42
    
The indivdual databases failed to display in SSMS –  icecurtain Jun 20 '11 at 9:45
add comment

migrated from stackoverflow.com Jan 21 '12 at 15:00

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

You can't delete the LDF file: it's essential.

For the NDF, you need to show that it's not used to SQL Server. You'd use DBCC SHRINKFILE with EMPTYFILE. Substitute xxx based on sys.database_files

DBCC SHRINKFILE (xx, EMPTYFILE)
share|improve this answer
    
I created few Ldf files as well what is the best way to remove these.? –  icecurtain Jun 20 '11 at 9:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.