DBCC WritePage is a dangerous undocumented DBCC command. It’s useful in your sandbox to change data, crash objects, and do some fun things you may think of. But never ever use it in your productions. Using DBCC WritePage command is at your own risk. . I will give you demos on how to use dbcc writepage to perform simple insert, delete, and update on a table.
dbcc writepage ({'dbname' | dbid}, fileid, pageid, offset, length, data [, directORbufferpool])
- {‘dbname’ | dbid}
- Database name or database id
- fileid
- File id in sys.database_files
- pageid
- Page number in the file
- offset
- Starting position of the data you want to change
- length
- number of bytes to be written to the page
- data
- data to be written. It’s binary, for example 0x13432
- directORbufferpool
- 2 possible values, 0 and 1. When it’s 0, which is also the default value, the data modification is done at buffer level, related data will be calculated automatically such as page hash. When it’s 1, the modification is written to disk directly, related values, such as page hash, will not be recalculated automatically. Unless you want to test your math level…
Read more