我在外部硬盘驱动器上有一个 SQL Server 数据库。我忘了分离数据库。我不再需要它了,但我无法将其删除或脱机。
当我尝试删除或使数据库脱机时,出现以下错误。
Msg 823, Level 24, State 2, Line 7
The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000012000 in file 'E:\Kenya Air\Monet - Paulus.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
我曾尝试运行 DBCC CHECK,但出现相同的错误。
最佳答案
尝试使数据库脱机然后联机。
Alter database DatabaseName set offline
然后过一会再上线
Alter database DatabaseName set online
关于sql-server - 尝试删除 SQL Server 数据库时出现错误 21,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38542477/