Unable to open the physical file

Asif Shaikh 1 Reputation point
2021-04-06T12:09:53.217+00:00

TITLE: Microsoft SQL Server Management Studio


Attach database failed for Server 'BIDCS1DEVSQLSVR'. (Microsoft.SqlServer.Smo)

For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.37971.0&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)


Unable to open the physical file "H:\BIDW\MSSQL\Data\DDCArchive\FG_201901". Operating system error 2: "2(The system cannot find the file specified.)".
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=14.00.3370&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476


BUTTONS:

OK


SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,713 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Shashank Singh 6,246 Reputation points
    2021-04-06T12:22:27.103+00:00

    H:\BIDW\MSSQL\Data\DDCArchive\FG_201901

    Check 2 things

    1. The location and file should be accessible.
    2. SQL Server service account should have read write permission on folder where data file is residing

    BTW FG_201901 does not looks like valid mdf file. mdf extension is missing

    0 comments No comments

  2. Tom Phillips 17,716 Reputation points
    2021-04-06T13:23:27.193+00:00

    I assume H: is a locally mapped drive. The service account does not have access to your mapped drives. You need to use a full UNC path to the files.

    0 comments No comments

  3. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-04-07T03:18:25.653+00:00

    Hi @Asif Shaikh ,

    > Unable to open the physical file "H:\BIDW\MSSQL\Data\DDCArchive\FG_201901". Operating system error 2: "2(The system cannot find the file specified.)".

    As others mentioned, please check below information.

    1. Make sure the file location is correct and the mdf file is exist in that location.
    2. Make sure your SQL server service account have the permission to read and write data file.
    3. Please make sure the File Extension for the Data File is mdf.
      85077-screenshot-2021-04-07-111802.jpg

    If the response is helpful, please click "Accept Answer" and upvote it, thank you.

    0 comments No comments