views:

34

answers:

1

I am trying to attach a database in sql 2005 but I get an error msg that the _log.ldf file was not found

How do I create the _log.ldf file?

TITLE: Microsoft SQL Server Management Studio

Attach database failed for Server 'localhost'. (Microsoft.SqlServer.Smo)


ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


Directory lookup for the file "C:\CreateMDF\TimeTracker_log.LDF" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft SQL Server, Error: 5133)

+1  A: 

If you don't specify a log file for creation then SQL Server should create a new one.

You can click the remove button for the log if you're attaching via the management console or you can have no log file specified if you're attaching via a script.

melkisadek
I am guessing SQL did not create one itself Do I lose functionality or performance if click on the remove button? Thanks
Csharp
I am getting an error when I run my database scripts:A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Csharp
If you're attaching a db to a server (as opposed to a restore from backup) then the general assumption would be that it had completed all it's previous transactions. Therefore removing the transaction log and letting SQL Server create from new should not affect functionality or performance.
melkisadek
The other error is a connection problem. As you're using a local SQL instance I'd guess that the second solution might work from here: http://msdn.microsoft.com/en-us/library/ms175496.aspx
melkisadek
Thanks very much !!
Csharp