question

AsifShaikh-4180 avatar image
0 Votes"
AsifShaikh-4180 asked Cathyji-msft commented

Unable to open the physical file

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-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AsifShaikh-4180,

We have not received a response from you. Did the replies could help you? If the response helped, do "Accept Answer". If it is not, please let us know. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.

0 Votes 0 ·
Shashank-Singh avatar image
0 Votes"
Shashank-Singh answered

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



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TomPhillips-1744 avatar image
0 Votes"
TomPhillips-1744 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered

Hi @AsifShaikh-4180,

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.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.