I want to corrupt a page inside a certain table and restore it.

How do I do that on SQL Server?


If you really want to do this, one way is to use a hex editor as Kendra Little explains, or perhaps you would prefer Brent Ozar's take on the same approach.

An alternative is to use DBCC WRITEPAGE as Simon Lieu describes.

Erik Darling also shows you a way to use DBCC WRITEPAGE, generating dynamic commands with dm_db_database_page_allocations.

For the single-page restore, see the documentation or Brent Ozar again.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.