I have an MDF file and no LDF files for a database created in MS SQL Server 2005. When I try to attach the MDF file to a different SQL Server, I get the following error message.
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.
I would like to accomplish any one of the following options:
- Attach the database without data loss (unlikely but would save me some time).
- Attach the database with data loss (whatever transactions were open are lost).
- Recover the schema only (no data) from the MDF file.
What SQL commands can I try to get my database going again?