将SQL Server连接到Windows共享文件夹

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将SQL Server连接到Windows共享文件夹相关的知识,希望对你有一定的参考价值。

This is how you can connect SQL Server to a Share folder for your backups. After running this, you will see the letter T: in the GUI. Each line must be run seperatly.
  1. EXEC xp_cmdshell 'NET USE'-- to list the mapped drives
  2. EXEC xp_cmdshell 'NET USE T: \10.106.74.20share /user:10.106.74.20pollusb password' --to connect
  3. EXEC xp_cmdshell 'DIR T: /b'
  4. EXEC xp_cmdshell 'NET USE T: /D' -- to remove the share
  5. -- Note : you can also make the connection permanent by using /PERSISTENT:YES
  6. -- More info on NET USE /? on CMD

以上是关于将SQL Server连接到Windows共享文件夹的主要内容,如果未能解决你的问题,请参考以下文章