SQL Server Performance, DBA Best Practices & Enterprise Data Solutions | MyTechMantra
Home » Learn SQL Server » Configure Network Drive Visible for SQL Server During Backup and Restore Using SSMS

Configure Network Drive Visible for SQL Server During Backup and Restore Using SSMS

Introduction

Most of the Development and Test Database Servers will not have enough disk space to store both the database and backup files in order to perform the periodic database refreshes. In such scenarios, the best option will be to store the database backup files in a mapped network drive and perform the database restores from the mapped drive. However, things can become really complicated when the developer tries to restore the database using SSMS and they couldn’t locate the respective mapped drive under Locate Backup File window as shown in the snippet below.

This article will help you understand How to Backup SQL Server Databases to a Mapped Drive (Backup to Network Drive). There are times when you need to take SQL Backup to Network Dive or even use SSMS to take backup of SQL Backup Database to Network Drive. Learn How to Give SQL Server Access to Network Share.

Locate Backup Files in SQL Server

In SQL Server Management Studio, if you try to browse the backup files, you will only see the local drives available to SQL Server Database Engine. In this article we will take a look at the approach on How to Configure SQL Server to Display Network Path Visible to SSMS to Perform Database Backup or Restore Commands.

How to Map a Network Drive

By default, a network share is not visible to SQL Server Database Engine. Hence, you will have to mark Network Share as a Mapped Network Drive using the using the Map Network Drive feature of the Operating System. Refer the below screenshots which highlights How to Create a Mapped Network Drive.

How to Map Network Drive in SQL Server
How to Map Network Drive in SQL Server
Specify Drive Letter for Network Drive and Share Folder Path to Map Network Drive as Local Drive
Specify Drive Letter for Network Drive and Share Folder Path to Map Network Drive as Local Drive

Once the Network Drive is mapped successfully the next Step will be to identify the network drive within SQL Server. This can be achieved by using XP_CMDSHELL command. For more information, see How to Enable and Disable XP_CMDSHELL command in SQL Server.

How to Map Network Drive in SQL Server | SSMS Backup Database to Local Disk

In the below script replace Drive Letter and Share Path with values in your environment to Map Network Drive in SQL Server.

EXEC XP_CMDSHELL 'net use Z: \\RemoteServerName\ShareName'

How to Verify Mapped Network Drive Mapping in SQL Server

Execute the below query by replacing the Dirve Letter with the Drive Letter which you have provided in your environment.

EXEC XP_CMDSHELL 'Dir Z:'

Once you have executed the above script successfully you will be to see “Z Drive” under Locate Backup File as shown in the below snippet.

Configure Network Drive Visible for SQL Server for Backup and Restore Using SSMS
Configure Network Drive Visible for SQL Server for Backup and Restore Using SSMS

How to Delete Mapped Network Drive Mapping in SQL Server

Execute the below TSQL code to Delete the Mapped Network Drive from SQL Server.

EXEC XP_CMDSHELL 'net use Z: /delete'

Trending SQL Server Tips

Recommendations

  • You can very well provide the full network location of the file in “File Name” field of “Locate Backup File” window. The approach mentioned in this article is only required if you wish to perform backup or restore using SQL Server Management Studio.
  • DBAs or Developers can very well backup or restore database from Network Share without Mapping the drive. This is only required if you wish to perform backup or restore using SQL Server Management Studio.
  • Once you have completed the Backup or Restore as a Best Practice on should disable XP_CMDSHELL in SQL Server. For more information see, How to Enable and Disable XP_CMDSHELL command in SQL Server
  • Learn more about SQL Server Security Best Practices

Ashish Kumar Mehta

Ashish Kumar Mehta is a distinguished Database Architect, Manager, and Technical Author with over two decades of hands-on IT experience. A recognized expert in the SQL Server ecosystem, Ashish’s expertise spans the entire evolution of the platform—from SQL Server 2000 to the cutting-edge SQL Server 2025.

Throughout his career, Ashish has authored 500+ technical articles across leading technology portals, establishing himself as a global voice in Database Administration (DBA), performance tuning, and cloud-native database modernization. His deep technical mastery extends beyond on-premises environments into the cloud, with a specialized focus on Google Cloud (GCP), AWS, and PostgreSQL.

As a consultant and project lead, he has architected and delivered high-stakes database infrastructure, data warehousing, and global migration projects for industry giants, including Microsoft, Hewlett-Packard (HP), Cognizant, and Centrica PLC (UK) / British Gas.

Ashish holds a degree in Computer Science Engineering and maintains an elite tier of industry certifications, including MCITP (Database Administrator), MCDBA (SQL Server 2000), and MCTS. His unique "Mantra" approach to technical training and documentation continues to help thousands of DBAs worldwide navigate the complexities of modern database management.

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.