Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am doing a backup:

BACKUP DATABASE timeclockplus TO DISK = 'c:\bak.backup'

and i am getting this error msg:

Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'c:\bak.backup'. Operating system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

anyone know what is going on here?

share|improve this question

migrated from stackoverflow.com Jul 16 '10 at 4:49

This question came from our site for professional and enthusiast programmers.

    
may not be not a good idea to fix in a vista/win7 box. better off backing up to another location then breaking your security permissions –  Nick Kavadias Jul 15 '10 at 1:56
    
Your filename is somewhat non-standard it should really be "backup.bak" not "bak.backup" –  Joel Mansford Jul 15 '10 at 14:37

3 Answers 3

up vote 4 down vote accepted

The SQL Server account presumably hasn't got write permissions to the root of C: Try the Backup folder for your instance (example path C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup)

If you use management studio to do the backup but click the "script" button instead of the OK button the default path should be one that works.

share|improve this answer
    
ok so how do i fix that? –  Yuck Jul 14 '10 at 16:32
    
how do i give it write permissions? –  Yuck Jul 14 '10 at 16:35
1  
Through Windows Explorer but obviously that would increase the surface area for escalation if any vulnerabilities exist in SQL Server or your code. Where is the instance? Is it installed on your machine or do you access it across a network? –  Martin Smith Jul 14 '10 at 16:41
    
it is locally installed –  Yuck Jul 14 '10 at 16:50
1  
You should be able to see the account that SQL Server is running under by opening the services applet (Start -> run -> services.msc -> OK). I'd create a dedicated Folder - e.g. C:\Backups rather than giving it permissions on the root of the drive though. It should be straightforward but if not you can use Process Monitor technet.microsoft.com/en-us/sysinternals/bb896645.aspx to see any ACCESS DENIED errors and the account that is denied access. –  Martin Smith Jul 14 '10 at 17:00

If it is a permissions issue, use Windows explorer (right click on your target C: drive, Properties, Security tab) to confirm that the account that the account underwhich the backup is running is allowed to modify/write.

share|improve this answer

Generally you don't want to backup to the root of a hard drive, which is why the SQL Server doesn't have rights to the root by default.

Just backup to another folder.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.