All my week of work in database

I’ve been working with database on SQL Server 2016 during all this week. But I couple of hours ago when I opened .mdf file SQL Server viewed: “Database consistency errors reported by DBCC CHECKB”. I tried to find any microsoft sql server database repair tool, but all what I found didn’t work out. Now, I’ve lack of ideas what to do.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

There might be other options out there. This is something that worked for me once but there are no guarantees that it will work at all times. Another way might ms sql database repair tool or manuals in the following Stop SQL Server instance -> Copy MDF and LDF files to another location -> Delete original MDF and LDF files -> Start SQL Server instance again -> Create new database with exact same name and file names -> Stop SQL Server -> overwrite newly created MDF and LDF. After this your database should be back online. If it is then go ahead and put it into EMERGANCY mode and SINGLE USER mode. Finally go ahead and execute DBCC CHECKDB like this DBCC CHECKDB (databaseName, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS If you can get to this and execute last command successfully you should be good.


Try going through these steps:

it’d be much easier if you had a backup even server snapshot backup.