Re: FORCE DB Corruption
From: Mark Allison (marka_at_no.tinned.meat.mvps.org)
Date: 11/19/04
- Next message: Andrew J. Kelly: "Re: System degrades after 49.71 days"
- Previous message: Andrew J. Kelly: "Re: System degrades after 49.71 days"
- In reply to: michelle: "FORCE DB Corruption"
- Next in thread: michelle: "Re: FORCE DB Corruption"
- Reply: michelle: "Re: FORCE DB Corruption"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 19 Nov 2004 16:30:15 +0000
This script from Sharon Dooley should do the trick - be careful with it
though!! I haven't tried it on SQL 2000, but it should work.
/* this script works on a database that is a copy of pubs. I created
this database easily with DTS This only works on SQL Server 7 databases
*/
/* NOTE: This script will truly corrupt a database. It should not be run
on ANY real database. It is only for simulating corruption for training
purposes.
*/
sp_configure allow, 1
go
reconfigure with override
go
update sysindexes set FirstIAM = 1234
where id = OBJECT_ID('roysched')
go
sp_configure allow, 0
go
reconfigure with override
go
-- Mark Allison, SQL Server MVP http://www.markallison.co.uk Looking for a SQL Server replication book? http://www.nwsu.com/0974973602m.html michelle wrote: > Hi, > > I need to test a script to ensure that it behaves appropriately after > running DBCC CHECKDB and finding 'errors'. I have an if statement that runs > if @@error = 0 but I want to make sure that it works as intended should DBCC > CHECKDB FIND errors. How can I force a database to become corrupt to a point > that DBCC CHECKDB will report errors? > > Thanks, > > Michelle > >
- Next message: Andrew J. Kelly: "Re: System degrades after 49.71 days"
- Previous message: Andrew J. Kelly: "Re: System degrades after 49.71 days"
- In reply to: michelle: "FORCE DB Corruption"
- Next in thread: michelle: "Re: FORCE DB Corruption"
- Reply: michelle: "Re: FORCE DB Corruption"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|