使用 xp_cmdshell 导出 csv
我正在尝试使用 xp_cmdshell
导出结果,但收到此错误:
“Sqlcmd:错误:打开或使用文件 (my_path) 时出错”。
这是我在 sqlserver 上写的:
exec xp_cmdshell 'sqlcmd -S my_server -d my_db -E -Q "my_query" -s "," -o "my_path"'
。
我尝试过使用命令行,并且我的指令有效。
我认为这可能是一个权限问题,但我对此类事情很陌生,我无法自己解决。我希望你们中的一些人可以帮助我,谢谢
I'm trying export my results using xp_cmdshell
but I recive this error :
"Sqlcmd: error: error while opening or using file (my_path)".
This is what I've wrote on sqlserver:
exec xp_cmdshell 'sqlcmd -S my_server -d my_db -E -Q "my_query" -s "," -o "my_path"'
.
I've tried using command line and on it my instructions works.
I think its can be an permissions trouble but I'm new on this type of things and I can't solve by myself. I hope that some of you can help me, thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论