【问题标题】:Use xp_cmdshell and bcp utility not working使用 xp_cmdshell 和 bcp 实用程序不起作用
【发布时间】:2020-06-09 18:19:36
【问题描述】:

在 SQL Server 2014 SP3 上运行这些

EXEC master..xp_cmdshell 'dir c:\' -- 这是有效的

** 以下是单行**

EXEC master..xp_cmdshell 'bcp "select name, type_desc, create_date from sys.objects" queryout "c:\bcptest2.txt" -T -Sbl3c0b\switch2014 -c -t,' --这不起作用

我从命令提示符成功运行了 bcp,但使用 xp_cmdshell 时它根本不起作用。

我已经运行了以下代码

EXEC master.dbo.sp_configure '显示高级选项', 1

重新配置

EXEC master.dbo.sp_configure 'xp_cmdshell', 1

重新配置

谢谢!

【问题讨论】:

  • 没关系。在家中使用 VPN 无法正常工作,但当我到工作空间时,它可以正常工作。
  • 你真的没有包含 -S 选项吗?还是您故意将其从帖子中删除?
  • 嗨 Jamie,-S 在 -T 选项之后

标签: bcp xp-cmdshell


【解决方案1】:

从家里使用 VPN 无法正常工作,但当我进入公司工作空间网络时,它可以正常工作。

我不知道为什么,但至少它按预期工作。

【讨论】:

    猜你喜欢
    • 2013-05-10
    • 1970-01-01
    • 1970-01-01
    • 2015-01-30
    • 1970-01-01
    • 2015-05-09
    • 2016-04-06
    • 1970-01-01
    • 2018-01-25
    相关资源
    最近更新 更多