Use Master
Go
sp_configure ’allow updates’,1
reconfigure with override
Go 
update sysdatabases set status=32768 where name=’AAA’ 
Sp_dboption ’AAA’, ’single user’, ’true’ 
DBCC CHECKDB(’AAA’) 
go
update sysdatabases set status=28 where name=’AAA’
sp_configure ’allow updates’,0
reconfigure with override
Go

解决方案 »

  1.   

    Use Master
    Go
    sp_configure 'allow updates',1
    reconfigure with override
    Go update sysdatabases set status=32768 where name='cs' 
    exec Sp_dboption 'cs', 'single user', 'true' 
    DBCC CHECKDB('cs',REPAIR_ALLOW_DATA_LOSS) 
    go
    update sysdatabases set status=28 where name='cs'
    goexec sp_configure 'allow updates',0
    reconfigure with override
    Go
      

  2.   

    sql server 企业管理器 中 使用 附加数据库 不行么?
      

  3.   

    不用建同名数据库,
    将MDF和LDF放到相应文件夹下后,
    附加数据库看看~~~