How to map network drive in SSMS

MSSQL-Feature-Image

We can use “xp_cmdshell” to run windows command, it also will return output.
We need to run the following SQL to enable “xp_cmdshell

Now we can map network drive via “xp_cmdshell“.
In the following example, we will temporarily map “Z:” to “\\WS01\Sources” as domain user “joeschoice\mssql-admin” with login password “P@ssw0rd”
When SQL Server or SQL service is restarted, this network drive will disconnect.

When we no need to use this network drive, remember to disconnect this by the following SQL.

How to map network drive in SSMS:

Author: Joe Chan

1 thought on “How to map network drive in SSMS

Comments are closed.