Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
i want to restore database from file(Tasks->Restore->Database. atrer i select from device and select file) via sql server management studio. After that i get this error:
The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\XXXXXX.mdf'. Msg 3156, Level 16, State 8, Server XXXX, Line 2


how to figure out this problem? is it security error?

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 13-Apr-12 8:03am
v3
Comments
OriginalGriff 13-Apr-12 14:03pm    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
ZurdoDev 13-Apr-12 16:27pm    
So, the error says access denied. Have you made sure there is sufficient permissions on the file itself and to wherever you are trying to restore to? The easiest way around it is to add the Everyone group with full control. After you are done remove the Everyone group.
Bernhard Hiller 16-Apr-12 2:40am    
Does the target file 'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\XXXXXX.mdf' already exist there?

Check your "mdf" file 'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\XXXXXX.mdf' location.
 
Share this answer
 
It must be permission problems with your server.
Check if you have access to the server your database refers to.
 
Share this answer
 
Check permissions and Services.msi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900