SQLCMD输出到日志文件以进行存储过程执行
尝试从Linux框运行以下命令,
sqlcmd -S<server> -d<db> -U<login> -P<pwd> -i /scripts/StoredProcedure1.sql -o /logs/output.log
如果SP在SSMS中执行,则通常会给出
Commands completed successfully.
Completion time: 2022-06-12T18:28:18.4580782-04:00
,但是在output.log中并未捕获它,因为它仅为零字节。
我如何也捕获该输出。
尝试了这些不同的组合
- -r [0 | 1](到stderr的msgs) - 并且它没有起作用
- -m error_level-并且它没有起作用
- https://ss64.com/nt/syntax-redirection.html - 它没有起作用,
这可能是我缺少一些愚蠢的东西或仅仅是错误的组合。谁能在这里帮忙。
Trying to run this below command from a Linux box,
sqlcmd -S<server> -d<db> -U<login> -P<pwd> -i /scripts/StoredProcedure1.sql -o /logs/output.log
If the SP is executed in SSMS it would normally give
Commands completed successfully.
Completion time: 2022-06-12T18:28:18.4580782-04:00
However this is not getting captured in the output.log as it is only of zero bytes.
How do I capture that output too.
Tried these, different combinations
- -r[0 | 1] (msgs to stderr) - and it did not worked
- -m error_level - and it did not worked
- https://ss64.com/nt/syntax-redirection.html - and it did not worked
May be i'm missing something silly or just putting in wrong combination. Could anyone help here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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