SQL server 2005 attach without transaction log – urgent !

sqlsql-server-2005

We had a crash in the sql server and the database remained in inconsistent mode.
We lost the transaction log file and the last generated backup is too old.

I googled this issue but mostly relevant posts I saw refer to SQL 2000

I saw this post
https://stackoverflow.com/questions/773059/how-to-recover-database-from-mdf-in-sql-server-2005
and run the steps:

  1. Detach database and move your mdf to save location.
  2. Create new database of same name, same files, same file location and same file size.
  3. Stop SQL server.
  4. Swap mdf file of just created DB to your save one.
  5. Start SQL. DB will go suspect.
  6. ALTER DATABASE yourdb SET EMERGENCY
  7. ALTER DATABASE yourdb SET SINGLE_USER
  8. DBCC CHECKDB (yourdb, REPAIR_ALLOW_DATA_LOSS)
  9. ALTER DATABASE yourdb SET MULTI_USER
  10. ALTER DATABASE yourdb SET ONLINE
    "

I got till step 8 [DBCC CHECKDB (yourdb, REPAIR_ALLOW_DATA_LOSS)] but each time I repeat the processes "DBCC CHECKDB" does not seems to do the job .

I get error "query completed with errors" and that the "Database 'dbname' is being recovered. Waiting until recovery is finished."

Any Help will be greatly appreciated
Thanks Ron

Best Answer

Take a look here: Recover a database without the ldf file to use the SP_ATTACH_SINGLE_FILE_DB proc