Tuesday 10 January 2012

How to recover from consistency problem in tables



solution 1:
sp_dboption 'dbname', 'single user', 'true'
go

dbcc checkdb ('dbname', REPAIR_REBUILD)
go

sp_dboption 'dbname'single user', 'false'
go



solution 2:
The second option is to run the query given by us through query analyser.This solution given may result in a certain degree of data loss proportionate to the corruption of data.The extent and amount of data loss cannot be determined before running the query. Run the query given below from SQL Query Analyser after taking a backup.

sp_dboption 'databasename', 'single user', 'true'
go

dbcc checkdb ('databasename', REPAIR_ALLOW_DATA_LOSS)
go

sp_dboption 'databasename, 'single user', 'false'
go

No comments:

Post a Comment

Please Leave Your Comment here

You Might also like this

Related Posts Plugin for WordPress, Blogger...