Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Corrupt Record in DB?

Author  Topic 

Kzimmerman
Starting Member

8 Posts

Posted - 2004-09-07 : 11:04:47
Apparantly i've ended up with a corrupted entry in one of my DB's here. Whenever i use crystal to run a report on the DB, it hits this one specific record and returns a 536 error regarding it. Everything i've looked up says that its 99% a corrupt record. If this is the case, is there a way to recover the corrupt data? If not, can the record be removed without going into the raw data and removing it that way? If not, what would be the best route to go into the data for removal? I dont want to risk anything cross linked to become damaged due to an "ugly removal". Also, does anybody know the best way to run integrity checks regarding converted & soon to be converted DB's so i can prevent this from occurring in the future?

Ken Zimmerman
MIS Dept
American Red Cross

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-09-07 : 11:30:57
dbcc checktable('Tablename')
Go to Top of Page

Kzimmerman
Starting Member

8 Posts

Posted - 2004-09-07 : 11:38:44
i assume that is for integrity checks? What about the removal of the corrupt record? It cant be deleted through the "standard" methods (select & remove), it returns a 536 error. Any ideas on that?

Ken Zimmerman
MIS Dept
American Red Cross
Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2004-09-07 : 12:35:41
Depending on how big your table is, could you select only the valid records out into a temp table and then truncate or drop the table with the faulty record, then rebuild and move the clean records back in?

Mike
"oh, that monkey is going to pay"
Go to Top of Page

Kzimmerman
Starting Member

8 Posts

Posted - 2004-09-07 : 12:52:03
quote:
Originally posted by mfemenel

Depending on how big your table is, could you select only the valid records out into a temp table and then truncate or drop the table with the faulty record, then rebuild and move the clean records back in?

Mike
"oh, that monkey is going to pay"



Ok, lets say the table is grossly too large to perform that option, what other ideas for fixing this do you have? Not sure if its actually too large to do that with or not, just wanna get as much input on it as i can before i start breaking stuff

Ken Zimmerman
MIS Dept
American Red Cross
Go to Top of Page

Kzimmerman
Starting Member

8 Posts

Posted - 2004-09-07 : 16:46:27
also, on an assumption that i have the ID of the corrupt record, is there a SQL command to delete the specific record? We've tried using the blackbaud console to delete it, and it cant be removed that way. Anybody got any ideas?

Ken Zimmerman
MIS Dept
American Red Cross
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-09-07 : 16:51:32
will this do?

delete from TableName
Where Id = IdOfRecord

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -