启动xp_cmdshell -- 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
备份设备上也用sa,
把本地的改为用户启动,进入管理工具服务选项。登录属性中用加入sa用户及密码
远程服务器地址\\192.168.0.2\备份文件\a.bak
backup database pubs to disk='\\192.168.0.2\备份文件\a.bak' with init
开映射
exec xp_cmdshell 'net use \\192.168.0.28\bak mima /user:192.168.0.25\administrator'
备份,
backup database [test] to disk='\\192.168.0.28\bak\a.bak'--后面可带各种参数
exec xp_cmdshell 'net use \\192.168.0.28\bak /delete'
http://community.csdn.net/Expert/TopicView1.asp?id=5315309
-- 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