sqlServer中修復有問題的表

字號:

sqlServer數(shù)據(jù)庫庫壞表的修復:
    1.將數(shù)據(jù)庫設置為單用戶模式
    exec sp_dboption ’庫名’ ,’single_user’,’true’
    2.修復表
    dbcc CHECKTABLE(’表名’,REPAIR_ALLOW_DATA_LOSS)
    3.將數(shù)據(jù)庫設置回多用戶模式
    exec sp_dboption ’庫名’ ,’single_user’,’false’