Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 920
  • Last Modified:

DBCC Corrupt

Anybody know the procedure to use DBCC corrupt, to forcibly corrupt a database table
0
amathur347
Asked:
amathur347
1 Solution
 
bretCommented:
Sure.  First off, it will only run against a database named "victimdb".

You then call dbcc corrupt with an object (id or name),  index id, and error number

Example:

dbcc corrupt(mytable, 1, 2540)

will cause a 2540 error on the clustered index of mytable.

There is a quite limited set of errors that this command can create, mostly errors
that TABLEALLOC will fix:  1133, 2502, 2503, 2521, 2523,2525, 2529, 2540, 2546, and 7939.

It is also not documented or supported in any way by Sybase (so if it fails to corrupt your
table, Sybase won't fix it so it does  :-)

-bret
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now