I have a situation where my PC would no longer start after a new dirver was loaded so I have reinstalled the OS and SQL Server. I am now attempting to restore a database that was operational under the previous SQL installation and am having some problems.

As the original SQL install failed there was no opportunity to detatch the database using sp_detach_db. The original SQL install did close down properly when the PC was rebooted after loading the problem driver.

Now when I attempt to reattach the database using sp_attach_single_file_db I get an error in the SQL log:

File c:Program Filesmssql7dataDATABASE_DEMO_log.LDF does not exist - unable to activate.

Where a database was detatched using sp_detach_db the system goes on to create the log file. As this database did not go through a sp_detach_db I am assuming it is not in a correct state to use sp_attach_single_file_db.

I had deleted the original LDF associated with the database thinking that sp_attach_single_file_db would do what it normally does and recreate the ldf file. I have also tried the CREATE DATABASE and sp_attach_db but they all appear to ultimately use the same method so I get the same error.

Perhaps what I need to do is fix the existing database file with some utility to put it in the same state as it would have been had I used sp_detach_db.

Has anyone heard of such a utility, or any other suggestions would be welcome.

Thanks