Tutorial :Attaching a database


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)


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)


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »