Sql-server – Starting up sql server after hard-drive recovery

recoverysql server

So I'm in a bit of a pickle. My primary work computer has recently crashed and some of the windows files were corrupted I tried repairing but did not work. This computer was running a program that stores all my customer information and invoice data(so pretty critical). This application had a Microsoft SQL server back end. I managed to recover the data and put it on a new computer, I can launch the application but it wont work since SQL server is not running.

When ever I try to start up SQL I get the following error "SQL Server could not fine the default instance(MSSQLSERVER)" which makes sense since its not actuality installed on this new computer. Is there anyway I would be able to transfer the data over to a new instance of SQL server if I cant start up the original SQL server ?

Asking the company that made the application is not possible since they went out of business a while back.

Best Answer

You can try attaching the MDF file to the new instance, but there is no guarantee that it will work. If the machine crashed while SQL Server was running, the files may actually be corrupt. If you don't have proper backups, you can try:

CREATE DATABASE tms ON 
(
  name = tms_Data, 
  filename = 'e:\path\tms_data.mdf' -- <-- move this file to the data location on new box
)
FOR ATTACH_REBUILD_LOG;

If that doesn't work, this will probably be a very expensive lesson about why we want to take backups regularly and store them in a different location.