DBCC Corrupt

Anybody know the procedure to use DBCC corrupt, to forcibly corrupt a database table
Who is Participating?
bretConnect With a Mentor Commented:
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


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  :-)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.