Reputation: 7005
I am using:
$ sqlcmd -S gigbat -d FOD -Q "BACKUP DATABASE [FOD] TO DISK='C:\testDBbak1.bak'"
Msg 3201, Level 16, State 1, Server gigbat, Line 1 Cannot open backup device 'C:\testDBbak1.bak'. Operating system error 5(Access is denied.). Msg 3013, Level 16, State 1, Server gigbat, Line 1 BACKUP DATABASE is terminating abnormally.
I assume it is trying to write to the server's c drive?
How can I specify my local c drive?
Upvotes: 0
Views: 421
Reputation: 10853
Doesn't this message say it all?
Operating system error 5(Access is denied.)
This just means that the account being used to run the sqlcmd
command does not have access to C:\
. If it is a windows account, you can try granting required permissions on that drive.
Also storing in the root of the boot partition is not a good idea. Consider creating a folder, assigning required access privileges and write to that folder
Upvotes: 1