首先,如果没有启用xp_cmdshell,请执行以下启用:

EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;
RECONFIGURE;

1.创建映射:

exec master..xp_cmdshell 'net use \\192.168.9.140\Share 123456 /user:192.168.9.140\administrator'

2.备份数据库:

backup database aa to disk='\\192.168.9.140\Share\testDB.bak' with init

3.删除备份:

exec master..xp_cmdshell 'net use \\192.168.9.140\Share /delete'

 

相关文章:

  • 2022-01-13
  • 2021-10-25
  • 2021-09-30
  • 2022-02-15
  • 2022-02-15
  • 2021-10-24
  • 2021-11-15
猜你喜欢
  • 2021-05-27
  • 2021-07-26
  • 2022-02-21
  • 2021-06-16
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案