6

I have to write a program that detects corrupted tables and tries to repair them. For this I need to corrupt tables regularly.

Is there anyway to corrupt tables manually?

migrated from stackoverflow.com Jan 21 '12 at 19:03

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

4

Paul Randal has several Sample corrupt databases to play with:

  • DemoDataPurity - 192-MB SQL Server 2005 database with a single 2570 (data purity) error

  • DemoFatalCorruption1 - 1-MB SQL Server 2005 database with a corrupt system table (that allows CHECKDB to complete)

  • DemoFatalCorruption2 - 1-MB SQL Server 2005 database with a corrupt system table (that terminates CHECKDB)

  • DemoNCIndex - 192-MB SQL Server 2005 database with a bunch of nonclustered index corruptions

  • DemoRestoreOrRepair - 1-MB SQL Server 2005 database with a page checksum failure (in fact a zero'd out page)

  • DemoCorruptMetadata - 1-MB SQL Server 2000 database with corrupt syscolumns table

Also, How to create a corrupt database using BULK INSERT/ UPDATE and BCP - SQL Server as a HEX editor.

  • Paul thanks for the database collection, but for testing i will be using our database. Thus i we need the tables of my database to be corrupt. Is there anyway to corrupt tables manually? – Karthick M Mayan Jun 1 '11 at 10:30
  • @Karthick M Mayan: Sure is. Read that last linked article I posted. – Mitch Wheat Jun 2 '11 at 5:17
0

I don't actually know what makes a table corrupt, but since you'll be scanning for certain symptoms, you know that, right? So you could just open the database file in, say, a hex editor and modify the corresponding data, e.g. change a value representing the number of records to come or something like that?

  • thanks Nicolas for the suggestion. will try something of his sort. – Karthick M Mayan Jun 1 '11 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy