Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 error Message when attaching a Database

Author  Topic 

JohnFen
Starting Member

3 Posts

Posted - 2012-08-13 : 07:03:52
I have only started using SQL recently and am getting the following message when i try to attach a database:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Attach database failed for Server 'johnfennell-pc\sqlexpress'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1750.9+((dac_inplace_upgrade).101209-1051+)&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:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\sheffcol2.mdf" failed with the operating system error 3(failed to retrieve text for this error. Reason: 15105). (Microsoft SQL Server, Error: 5133)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1617&EvtSrc=MSSQLServer&EvtID=5133&LinkId=20476

I have attached other databases without any issues, anybody got any ideas on what to do?

JohnFen
Starting Member

3 Posts

Posted - 2012-08-13 : 07:10:53
I must add, that I am logged into SQL Management studio as Administrator
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-08-13 : 07:11:43
Does
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\sheffcol2.mdf
exist?
Is it being used by another database?

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

JohnFen
Starting Member

3 Posts

Posted - 2012-08-13 : 09:05:30
No it is not in use...

Originally I had a database called Sheffcol. I renamed it it to Sheffield and attached this without any issues

I then took a copy and renamed it to SheffieldSCCNT and tried to attach, this is when the issue is arising
Go to Top of Page
   

- Advertisement -