--要先启用高级选项配置

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

--再打开'xp_cmdshell'
EXEC sp_configure 'xp_cmdshell', 1;
RECONFIGURE;


EXEC master..xp_cmdshell 'bcp "dC.dbo.C_ListTable" out c:\tmp01.xls -c -q -S"TG-PC" -U"sa" -P"password"'

--下面是关闭

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

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2021-08-09
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2021-11-13
相关资源
相似解决方案