Sql Server备份到远程服务器的另一种方法

需要在SQL Server 2005 里用xp_cmdshell运行 net use,创建主服务器和远程共享文件夹之间的连接。

首先在外围应用配置器里,启动xp_cmdshell。

然后在SQL Server Management Studio里新建查询,输入:

master..xp_cmdshell 'net use \\<remotecomputer>\<sharefolder> <password> /user:<remotecomputername\loginname>'

这样就可以了,记得运行此语句后要去外围应用配置器里关闭xp_cmdshell。

如果想要关闭这个连接的话,重新启动xp_cmdshell,在SQL Server Management Studio里新建查询,输入:

master..xp_cmdshell 'net use \\<remotecomputer>\<sharefolder>  /delete'

再次关闭xp_cmdshell。

 武通提供

posted on 2008-12-26 17:57  广思  阅读(294)  评论(0编辑  收藏  举报

导航