Brief introduction
Some time, due to log corruption and other reasons, caused the database query. If you detach the database at this point, you will find that you can no longer attach the database, and the consequences are serious. Therefore, this article provides a way to make the database query and isolate the instance, still can use a hack method to attach.
Specific steps
There is currently a database attchsuspectdatabase with only one table test, with only one column of int, where the data is currently 1, 2. We make the database questionable, as shown in Figure 1.
Figure 1. Database questioning
At this point, we detach the database. Attempt to attach, display failed, as shown in Figure 2.
Figure 2. The database is no longer attached
Even if we use the method of rebuilding the log, we find that it is still not attached, as shown in Figure 3.
Figure 3. Attempt to rebuild log method append, still invalid
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/