I am getting an error Msg 2503, Level 16, State 1 Table Corrupt on my SQL Server - what can I do?

A. Full error message is - "Msg 2503, Level 16, State 1 Table Corrupt: Page linkage is not consistent; check the following pages: current page#=xxx; page# pointing to this page=yyyy; previous page#=zzzz"

Make sure that is a "real" 2503 by running the dbcc in single-user mode as they can be spuriously reported if updates are occuring at the time of the dbcc.

At this point if you have a good backup and will not lose any data, then now is the time to use it. If you don't have a good backup then look at your backup procedures! To try and resolve the problem read on :-

Use DBCC PAGE (doc'd in the Books Online) to determine whether the page is a data or index page. If it is an index you are in luck and you may be able to drop and recreate the index.

If it is not an index page or this does not work then you will need to transfer all the data/objects into a new database. For the problem table(s) this may not work as the page chain is broken, so you will probably need to manually select out data in ranges based on keys above and below the broken point.

Once you have transferred all the objects across drop the old database and rename the new one.

If you don't want to transfer all the data across then you can just do the broken table. When this is done, rename the broken table by directly updating it's name in sysobjects. Then create a new table with the old name. Make sure no other errors are in the database first. Make sure you also re-create any views/stored-procedures that reference the table so that they start pointing to the new one.

If the above is not possible due to the size of the database or other reasons then your only alternative is to pay for Microsoft PSS support who may be able to patch the pointers in the tables/pages directly for you. However this sort of fix is not guaranteed and is done (if at all) on a best efforts basis totally at your risk.


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish