Backup SQL Server databases to a remote mapped drive

Have you ever encountered the “The system cannot find the path specified.” error when taking backups for SQL Server databases onto a mapped drive?

Typically you encounter this message because a network share that you map using a local drive letter will not be visible to a SQL Server instance as it is running as a service. So, the SQL Server service runs in the context of the local console with the security context of the startup account of SQL Server. Also, mapped drives are specific to a session and not visible to a service started in the local console context.

The workaround to resolve this messages is below”

1. Run the following command from a query window  EXEC xp_cmdshell ‘net use <drivename> <share name>’

– where
<drive name>: Letter used to map the drive
<share name>: UNC path to the share

2. After that you should be able to backup using the mapped drive letter

3. Your Management Studio Object Explorer logical drive enumeration window should be able to list the above mapped drive

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.