Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

BACKUP DATABASE ankit TO DISK = 'C:\Ankit_Full.bak'

I am writing this query for database backup but it's not running.

this query getting error:-
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'C:\Ankit_Full.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.


How can we solve?
I have checked all service, everything is ok.

Please help me.

Thanks
Ankit Agarwal
Software Engineer
Posted

For some time now it isn't allowed to write directly to the root of the primary drive used to boot windows. Simply put it into a subdirectory.

Good luck!
 
Share this answer
 
Comments
thatraja 8-Nov-13 7:20am    
Right & even if it allows to save in root path, that's not suggestable. 5!
CHill60 8-Nov-13 7:59am    
And my virtual 5 for this very valid comment!
thatraja 8-Nov-13 8:08am    
My real thanks
 
Share this answer
 
Comments
CHill60 10-Nov-13 7:29am    
Potentially useful link, but off topic as the OP was trying to write the backup file to the root of the C: drive, which is not a good idea even if the process does have the necessary access rights

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