When trying to backup a SQL Server database to a network drive or UNC path, you get the following error:
Microsoft SQL Server Management Studio
Backup failed for Server <<SQL Server>>. (Microsoft.SqlServer.SmoExtended)
Additional information: System.Data.SqlClient.SqlError: Cannot open backup device “<<UNC path / Network drive>>’. Operating system error 32 (The process cannot access the file because it is being used by another process.). (Microsoft.SqlServer.SmoExtended)
This is because you cannot use a UNC path or network drive to backup a SQL Server database. To work around this, backup the SQL Server database to a local drive then use your corporate backup software or a batch file to backup the backup file created. If you are using a batch file, you may wish to setup some form of alerting to ensure that the backup doesn’t fail.