Here is the solution provided by Patrick Flynn. Congratulations Patrick for being one of this weeks winners. I really liked this solution for a number  of reasons, first it showed how to pull data from DBCC Page and actually convert it into rows and columns that could then be inserted back into a table. Secondly due to its use of …

Corruption Challenge 4 – Alternate Solution Read more »

Congratulations to Randolph West who won the corruption challenge this week with the following solution which restored all of the data. First he restored the database to get started. Note some of his code and comments have been reformatted to better fit in the blog format. Restore database. I use KEEP_CDC and KEEP_REPLICATION because of the hints you dropped in …

Corruption Challenge Week 4 – The Winning Solution Read more »

The database name is [CorruptionChallenge4], it was created and backed up on SQL Server 2008R2. Sorry, no SQL Server 2005 this week due to features in the challenge that didn’t exist in SQL Server 2005 (perhaps that a hint).   Here is what we know. Everything was just fine, and all of a sudden users started reporting the following error …

Week 4 Challenge Details Read more »

Welcome to the fourth of 10 weeks of the Database Corruption Challenge (DBCC), this is the fourth in an about weekly competition. Here is how it works; I have created a corrupt database, hopefully more corrupt or more challenging than the previous week. I then solved the corruption myself, in order to prove that it is possible to fix, without …

Week 4 Database Corruption Challenge Read more »

Welcome to the third week of the Database Corruption Challenge (DBCC), this is the third in an about weekly competition. Here is how it works; I have created a corrupt database, hopefully more corrupt or more challenging than the previous week. I then solved the corruption myself, in order to prove that it is possible to fix, without data loss. This week …

Week 3 Database Corruption Challenge Read more »

With week two of the Database Corruption Challenge being just as interesting as week one, and after seeing yesterdays blog posting showing the solution by Rob Farley, you might be thinking you are ready to take on corruption. If you are interested in giving the corruption challenge a try, please sign up for my newsletter so that you will be notified …

Database Corruption Challenge #2 – Alternate Solution Read more »

Welcome to the second Database Corruption Challenge (DBCC), this is the second week in an about weekly competition. Here is how it works; I have created a corrupt database, hopefully more corrupt or more challenging than the previous week. I then solved the corruption myself, usually in 2 or 3 different ways in order to prove that it is possible …

Week 2 Database Corruption Challenge Read more »

Week 2 Challenge: You can download a zip file with multiple backup files created on SQL Server 2008 that can be restored and used on SQL 2008, SQL Server 2008R2, SQL Server 2012 or SQL Server 2014. The story… A backup was run yesterday, after that backup several changes were made to the database, inserts deletes, updates, and more. Sometime …

Week 2 Challenge Details Read more »

Most DBAs know the usual difference between TRUNCATE and DELETE FROM, however one not so obvious difference between the two is how things are handled if the table is corrupt. For instance, if you look at the corrupt database from the Database Corruption Challenge Week 1, you see the following If you want to clear out the corrupt Revenue table, …

Difference Between TRUNCATE TABLE and DELETE FROM Table Read more »

After posting the winning solution for Corruption Challenge 1 from Brent Ozar, I realized that he and I both solved the corruption by using the REPAIR_ALLOW_DATA_LOSS option on CheckDb. A very nasty move, however it did repair the corruption.   After reading some feedback, one of the winners stated: As soon as he ran REPAIR_ALLOW_DATA_LOSS, I knew we weren’t on …

Corruption Challenge 1 – An alternative solution Read more »