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.

We are having a database in which one table name dbo.ONOA is corrupt. We need to delete this table. Please let me is there any way to force delete the table?

share|improve this question

migrated from stackoverflow.com Jun 29 '12 at 12:34

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

2  
what error are you receiving while dropping? –  Romil Jun 29 '12 at 11:44
    
Also run DBCC CHECKCATALOG and post whatever errors you get here too. Its possible that you can't do the drop until you've fixed the errors. –  Jon Egerton Jun 29 '12 at 11:57
    
Does drop table YourTableName not work?? If so, what error is thrown? –  Thomas Stringer Jun 29 '12 at 13:07

1 Answer 1

Have you used DBCC CHECKTABLE to see what the problem is? Check the REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD options to potentially repair the table. Database must be set in single user mode.

share|improve this answer
1  
Just want to clarify, since the separate sentences might be interpreted in strange ways. Be sure you use CHECKTABLE, not CHECKDB, with the REPAIR_ALLOW_DATA_LOSS option. If you inadvertently do this at the database level and not the table level, you could irrevocably "repair" some other table that is having an issue you haven't yet detected. I know you aren't suggesting that at all @David, I just want to be sure people don't come across the REPAIR options and immediately associate them with CHECKDB. –  Aaron Bertrand Jun 29 '12 at 12:45

Your Answer

 
discard

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