Reputation: 1350
SQL Server 2012 instance is running on MyDatabaseServer
. I failed to attach database when I attach database on another machine on the network.
If I login to MyMachine
, open SSMS, connect to MyDatabaseServer\MyDB
and run the following code, it FAILS.
If I login to MyDatabaseServer
, open SSMS, connect to MyDatabaseServer\MyDB
and run the following code, it WORKS.
I need it to run on another machine other than the DB server itself. What should I do???
Note 1: The code I ran:
CREATE DATABASE MyDatabase ON
( FILENAME = N'\\MyFileserver\MyFolder\MyDatabase.MDF'),
( FILENAME = N'\\MyFileserver\MyFolder\MyDatabase_Log.LDF')
FOR ATTACH
It returns:
Unable to open the physical file "\MyFileserver\MyFolder\MyDatabase.MDF". Operating system error 5: "5(Access is denied.)".
Note 2: The account to run SSMS and the service account to run SQL Server both have full control permission to \\\\MyFileserver\\MyFolder\\
as well as MyDatabase.MDF
Note 3: I am able to connect to the DB MyDatabaseServer\MyDB
on both machines SSMS.
Note 4: It is SQL Server 2012. MyDatabaseServer
is a Windows Server 2012. MyMachine
is Windows 7.
Upvotes: 1
Views: 291
Reputation: 6683
SQL server database must be on the same machine as the server is installed
Upvotes: 1