1

Strange, I tried to attach the database AdventureWorks from this site - http://sqlserversamples.codeplex.com/

However, I encounter the following problem while attaching AdventureWorks2008R2_Data.mdf

Attach database failed for Server '{SERVER_NAME}{INSTANCE_NAME}'. (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:\Program Files\Microsoft SQL Server\MSSQL10.50.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008R2_Log.ldf" failed with the operating system error 3 (The system cannot find the path specified.). (Microsoft SQL Server, Error: 5133)

0

You need the "AdventureWorks2008R2_Log.ldf" file. And put it in this folder: "C:\Program Files\Microsoft SQL Server\MSSQL10.50.MSSQLSERVER\MSSQL\DATA\"

The easiest thing to do is download the "full backup" file from that site and then restore it, (instead of attaching.)

0

You need to have the file in the location mentioned by BOB above and as well I found that when you are trying to attach the Database, it's taking another log file into the "database details" dialogue box in the attach databases menu

You need to delete the log file which pops up along with the MDF file. This log file is from another database (in case if you are having Adventureworks2014 database as well)

The attach database then runs successfully without throwing any errors

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.