0

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)

asked Jan 7, 2010 at 4:25

1 Answer 1

1

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.

answered Jan 7, 2010 at 4:34
Sign up to request clarification or add additional context in comments.

4 Comments

I am guessing SQL did not create one itself Do I lose functionality or performance if click on the remove button? Thanks
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.)
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.
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: msdn.microsoft.com/en-us/library/ms175496.aspx

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.