(FILENAME = '**\machineRemote**ShareName\sample\sample_database.mdf
It's not supported to host database files on a NAS.
It may work, but the smallest network hickup and the database file(s) may get damaged.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to work on a query to attach a database (UNC path) remotely. I have SQL Server management studio (SSMS) installed in SQL Server machine (machineSQL) and also in another machine (machineRemote) in same domain.
Query::
CREATE DATABASE "simpleData" ON
(FILENAME = '\\machineRemote\ShareName\sample\sample_database.mdf'),
(FILENAME = '\\machineRemote\ShareName\sample\sample_database_log.ldf')
FOR ATTACH;
If I run the query in SSMS on machineSQL. The database gets attached successfully. But if I run it in SSMS on machineRemote it throws an error like :
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "\\machineRemote\ShareName\sample\sample_database.mdf". Operating system error 5: "5(Access is denied.)".
Msg 1802, Level 16, State 7, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
NOTE : The issue is occurring only if windows authentication is used to log in SSMS. SQL Server authentication works just fine. I have tried domain user permission on the database file path and also tried running SQL Server services as domain user, still no luck.
Need help on this.
(FILENAME = '**\machineRemote**ShareName\sample\sample_database.mdf
It's not supported to host database files on a NAS.
It may work, but the smallest network hickup and the database file(s) may get damaged.
My problem was in the file stream backup restore, which I fixed below5.png
2-----Acsess Full user MSSQLSERVER to Folder And User LOCAL
Finally : Disable Anti Viruse
Typically the Sqlserver service account is a local account which does not have network access permissions. You need to change the service account to a domain account and give the domain account permissions to the file share.
be aware that mounting database file from a network drive is not supported and the database files may become corrupted.