Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Error in attaching Adventureworks 2012 database Expand / Collapse
Author
Message
Posted Monday, May 27, 2013 4:55 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, November 12, 2013 6:26 PM
Points: 23, Visits: 29
hi i have problem in attaching Adventure works 2012 database
Attach database failed for Server '..........\MSSQLSERVER2012'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

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

------------------------------

Directory lookup for the file "C:\CodePlex Database\AdventureWorks2012_log.ldf" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft SQL Server, Error: 5133)
Post #1457156
Posted Monday, May 27, 2013 8:53 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, April 14, 2014 11:16 PM
Points: 16, Visits: 220
Directory lookup for the file "C:\CodePlex Database\AdventureWorks2012_log.ldf" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft SQL Server, Error: 5133)


SQL server can't find the log file. Have you double checked that it's in the path mentioned above?

If you're restoring from the GUI you can change the path to the log file in the bottom half of the attach dialogue. or just change the path in your create database statement.

CREATE DATABASE AdventureWorks2012 ON (FILENAME = 'M:\Data\AdventureWorks2012_Data.mdf'), 
(FILENAME = 'L:\Tlogs\AdventureWorks2012_Log.ldf') FOR ATTACH;

Post #1457171
Posted Thursday, May 30, 2013 2:42 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, January 31, 2014 2:56 AM
Points: 483, Visits: 256
The database is looking for the log file in the directory specified in the mdf file, not where you placed it.

T-SQL

USE [master]
GO
CREATE DATABASE [AdventureWorks2012] ON
( FILENAME = N'<Enter path to the mdf file here>\AdventureWorks2012_Data.mdf' )
FOR ATTACH
GO

This will create a new ldf file in the default log file directory.


Management Studio

In the Attach Databases dialog box:
Click the Add button and browse to the mdf file
Click on the row that specifies the log file
Click the Remove button
Click OK
Post #1458085
Posted Monday, September 30, 2013 12:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 30, 2013 11:58 AM
Points: 5, Visits: 4
I have tried it as well but failed, can we connect over skype please
Post #1499857
Posted Monday, September 30, 2013 1:17 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:35 AM
Points: 12,206, Visits: 9,169
chikatinelson (9/30/2013)
I have tried it as well but failed, can we connect over skype please


With which error did it fail?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1499871
Posted Monday, September 30, 2013 1:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 30, 2013 11:58 AM
Points: 5, Visits: 4
http://www.mssqltips.com/tipimages2/2638_Attach2.jpg..
Post #1499879
Posted Monday, September 30, 2013 1:48 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:35 AM
Points: 12,206, Visits: 9,169
chikatinelson (9/30/2013)
http://www.mssqltips.com/tipimages2/2638_Attach2.jpg..


When using the GUI for attaching a database, select the MDF file in the upper part, then delete the log file in the below part (the database details).




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1499881
Posted Monday, September 30, 2013 1:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 30, 2013 11:58 AM
Points: 5, Visits: 4
I deleted the log file and soon after that the 'message' column on the upper part indicates "Not Found"
Post #1499885
Posted Monday, September 30, 2013 2:13 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:35 AM
Points: 12,206, Visits: 9,169
chikatinelson (9/30/2013)
I deleted the log file and soon after that the 'message' column on the upper part indicates "Not Found"


Screenshot?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1499890
Posted Monday, September 30, 2013 2:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 30, 2013 11:58 AM
Points: 5, Visits: 4
Check the uploaded document

  Post Attachments 
Doc1.docx (8 views, 104.16 KB)
Post #1499893
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse