В случай, че база не може да се закачи към SQL Server с подобна грешка:
1 |
The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure. |
и стандартната команда с ATTACH_REBUILD_LOG не работи, може да се използва ATTACH_FORCE_REBUILD_LOG, която ще създаде лог-а при всички ситуации.
1 2 |
CREATE DATABASE SQLAuthority ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\SQLAuthority_original.mdf') FOR ATTACH_FORCE_REBUILD_LOG |
Взето от тук: