In previous posts I've explained how to use a hex editor to corrupt a database for testing and exploration. MVP Tony Rogerson has gone one step further by using bulk load to import a database into SQL Server and then create various corruptions using regular T-SQL. Checkout his *fantastic* blog post here and look through some of my earlier posts for details of on-disk data structures that you can corrupt.
Its very important that you try running CHECKDB on a known corrupt database so you can test whatever logic you have to notify you of database corruptions.
Have fun!
Anonymous comments are disabled
About Paul Randal - MSFT
Paul started in the industry in 1994 working for DEC on the VMS file system and check/repair tools.
In 1999 he moved to Microsoft to work on SQL Server, specifically on DBCC. For SQL Server 2000, he concentrated on index fragmentation (writing DBCC INDEXDEFRAG and DBCC SHOWCONTIG) plus various algorithms in DBCC CHECKDB. During SQL Server 2005 development Paul was the lead developer/manager of one the core dev teams in the Storage Engine, responsible for data access and storage (DBCC, allocation, indexes & heaps, pages/records, text/LOB storage, snapshot isolation, etc). He also spent several years rewriting DBCC CHECKDB and repair. For SQL Server 2008, Paul managed the Program Management team for the core Storage Engine to become more focused on customer/partner engagement and feature set definition.
In 2007, after 8.5 years on the SQL Server team, Paul left Microsoft to join his wife, Kimberly Tripp, running SQLskills.com and pursuing his passion for presenting and consulting.
Paul regularly presents at conferences and user groups around the world on high-availability, disaster recovery and Storage Engine internals. His popular blog is at http://www.sqlskills.com/blogs/paul/.