Reputation: 9
I want to attach my .mdf file into my local sql from the other computer but sql throw the exception:
Directory lookup for the file "\DATA\SAGOHANO-Server\SQL\SaGoHaNo.mdf" failed with the operating system error 5(Access is denied.).
my code here:
CREATE DATABASE SaGoHaNo
ON (FILENAME = '\\DATA\SAGOHANO-Server\SQL\SaGoHaNo.mdf'),
(FILENAME = '\\DATA\SAGOHANO-Server\SQL\SaGoHaNo_log.ldf')
FOR ATTACH;
Everyone may help me to fix my issue,please?
Upvotes: 0
Views: 817
Reputation: 2156
Provide the complete Server location path like
FILENAME = '\\SERVERNAME\DATA\SAGOHANO-Server\SQL\SaGoHaNo.mdf'
OR Try
FILENAME = '\\SERVERNAME\D$\DATA\SAGOHANO-Server\SQL\SaGoHaNo.mdf'
D$ - $ sign after the drive Name
Upvotes: 0
Reputation: 28890
Error message is clear..
The Account under which SQLServer is running doesn't have access to the share in the question..Add the account and give appropriate permissions
Upvotes: 0