Friday, May 14, 2010

System.Data.SqlClient.SqlError: Cannot open backup device ''. Operating system error 5(Access is denied.)

To prepare a Team Foundation Server upgrade, I was creating backups of some databases. But I didn’t got far, because following error was shown in the SQL Server Management studio each time I tried to create a backup:

System.Data.SqlClient.SqlError: Cannot open backup device 'd:\backups'. Operating system error 5(Access is denied.). (Microsoft.SqlServer.Smo)

Even after logging in as Administrator , I got the same error. 

After some investigation I found out that it doesn't matter who *you* are logged in as, it is the service account for SQL Server service that matters. So after changing the security permissions on the ‘d:\backups’ folder to give the service account (Network Service) write permissions, everything worked.

5 comments:

Anonymous said...

Thank you.

Anonymous said...

thanks for this information !!

Anonymous said...

Thanks for the information.

Anonymous said...

Thanks. This worked.

Rahul Patil said...

Thanks.This worked..