我們的品牌

Impact-Company-Logo-English Black-01-177x54

歡迎造訪施耐德電機全球網站

歡迎訪問我們的網站
		
我们今天能为您提供什么帮助?
How to backup SQL Server databases to a mapped drive

Article available in these languages: Czech

Issue
When executing a backup on a SQL Server database where the resulting backup file is directed onto a mapped drive you receive the following error message:
"The system cannot find the path specified."

Product Line
Struxureware Power Monitoring
Power Monitoring Expert
ION Enterprise
ION EEM

Environment
SQL Server 2008 R2, SQL Server 2012, SQL Server 2014, SQL Server 2016

Cause
A network share that is mapped using a local drive letter will not be visible to a SQL Server instance as it is running as a service.
The SQL Server service runs in the environment of the local console with the security of the startup account of SQL Server applied.
Mapped drives are specific to a session and not visible to a service started on the local console.

Resolution
*Warning: The actions below should be performed by qualified personnel. Take backups of any files prior to modifying them. Ensure the backups are in a location
that will not be overwritten (i.e. the Desktop).*

To backup a SQL Server database to a mapped drive using a local drive letter:

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

If xp_cmdshell is not enabled, you'll get a system error. To enable xp_cmdshell, run the following query:

-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1;
GO
-- To update the currently configured value for advanced options.
RECONFIGURE;
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1;
GO
-- To update the currently configured value for this feature.
RECONFIGURE;
GO


If the mapping needs a user login, modify the netuse.  Open up command prompt window and use the following command:
net use <drivename> <share name> /user:username password

Example:  net use z: \\servername\folder /user:username password

2. You should be able to backup using the mapped drive letter, as the Management Studio Object Explorer drive window should now list the above mapped drive

Note:

A drawback of this resolution is that once the SQL Server service is restarted, the mapped drive will no longer be visible as it will become unmapped.
If you want to retain the mapped drive information then you need to create a startup procedure for executing the script in Step 1.
One simple method would be to create a backup device using the UNC path of the remote share that you would like to take the database backups on.
It is important to keep in mind that the SQL Server startup account needs to have full permissions on the remote share.

施耐德電機Taiwan

探索更多
系列:
探索更多
系列:

需要協助?

  • 產品選型工具

    快速輕鬆地為您的應用找到合適的產品和附件。

  • 取得報價

    立即線上提交您的銷售需求,專業團隊將主動聯繫您。

  • 購買地點

    輕鬆在您所在地區找到最近的施耐德電機經銷商。

  • 支援中心

    在同一位置找到滿足您所有需求的支援資源。

  • 產品文檔
  • 軟體下載
  • 產品選型工具
  • 產品替代和替換
  • 幫助和聯絡中心
  • 尋找我們的辦公室
  • 取得報價
  • 人才招募
  • 公司簡介
  • 舉報不當行為
  • 無障礙
  • 新聞中心
  • 投資者
  • 專業洞察
  • 台灣施耐德電機學院
  • 綠色影響力落差調查
  • Schneider Go Green 2025
  • 隱私政策
  • Cookie通告
  • 使用條款
  • Change your cookie settings