--参考
1、共享本地文件夹 D:\temp 共享名为 test
net share test = D:\temp
2、执行SQL在数据库服务器上创建映射 z:
exec master..xp_cmdshell 'net use z: \\server\test 密码 /user:administrator'
3、执行备份
backup database Northwind to disk = 'z:\\Northwind_20060101.bak'
4、删除数据库服务器上的映射 z:
exec master..xp_cmdshell 'net use z: /delete'
5、取消本机共享文件夹 test
net share test /delete
转载于:https://www.cnblogs.com/bingyuw/articles/1334890.html