直接新建脚本执行:把test换成挂起数据库名称
USE master
GO
ALTER DATABASE test SET SINGLE_USER
GO
ALTER DATABASE test SET EMERGENCY
GO
DBCC CHECKDB(test,REPAIR_ALLOW_DATA_LOSS)
go
ALTER DATABASE test SET ONLINE
GO
ALTER DATABASE test SET MULTI_USER
GO
直接新建脚本执行:把test换成挂起数据库名称
USE master
GO
ALTER DATABASE test SET SINGLE_USER
GO
ALTER DATABASE test SET EMERGENCY
GO
DBCC CHECKDB(test,REPAIR_ALLOW_DATA_LOSS)
go
ALTER DATABASE test SET ONLINE
GO
ALTER DATABASE test SET MULTI_USER
GO