Undetached databases cannot be attached

  • Hi.

    I am not sure how to describe this but I will have a go.

    I uninstalled SQL Server 2008 R2.

    I installed SQL Server 2014 and tried to attach the databases but they weren't even visible on the file list during browse.

    Then discovered I should have detached the databases before uninstalling.

    So I thought maybe I should reinstall SQL Server 2008 R2 then open them so I can detach them.

    However, the files still are not visible during browse when I try to attach them.

    I also tried attaching AdventureWorks_Data.mdf but that was not visible either.

    I guess it was a newbie error - at least that's my excuse.

    Is this fixable?

    Thanks

  • Quick thought, check the file/folder permissions and make certain thar the Sql Service can access the files.

    😎

  • Thanks but no joy.

    When I open the Attach Database dialogue box to locate a database, no files appear in the window.

    If I type the file name manually, a message says File Not Found.

    If I proceed anyway, it fails and an error appears:

    TITLE: Microsoft SQL Server Management Studio

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

    Attach database failed for Server 'ABC-TWELVE'. (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2500.0+((KJ_PCU_Main).110617-0026+)&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)

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

    Cannot create file 'd:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\AdventureWorks_log.ldf' because it already exists. Change the file path or the file name, and retry the operation.

    Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted.

    File activation failure. The physical file name "d:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\AdventureWorks_Log.ldf" may be incorrect. (Microsoft SQL Server, Error: 5170)

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

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

    BUTTONS:

    OK

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

  • nick 51459 (3/31/2015)


    Thanks but no joy.

    When I open the Attach Database dialogue box to locate a database, no files appear in the window.

    This tells me that the permissions have not been fixed!.

    😎

    Fix the permissions, you can use cacls to list them.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply