使用 SQLCMD 创建文件时指定行终止符

发布于 2024-08-28 09:14:25 字数 165 浏览 7 评论 0原文

使用sqlcmd输出查询结果时如何指定行终止符?

bcp 不是一个选项。

sqlcmd -E -s"   " -Q "Select * From SomeTable" -o C:\Output.txt  -W

默认行终止符是什么?

How do you specify the the row terminator when outputting query results using sqlcmd?

bcp is not an option.

sqlcmd -E -s"   " -Q "Select * From SomeTable" -o C:\Output.txt  -W

What is the default row terminator?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦在深巷 2024-09-04 09:14:39

您只能使用 -s 选择列分隔符。没有指定行终止符的选项。

所以它是 CR + LF 因为输出进入命令行。但是,数据可能会被截断,因此您必须控制输出宽度。

请参阅 sqlcmd 了解 -s、-w、 正如您所说, -W、-y、-Y 等

bcp 可能不是一个选项,但 sqlcmd 中的行终止符也不是一个选项...

You can only choose column separator with -s. There is not option to specify row terminator.

So it is CR + LF because the output goes to command line. However, data may be truncated so you have to control the output width.

See sqlcmd for -s, -w, -W, -y, -Y etc

bcp may not be an option, as you say, but neither is row terminator in sqlcmd...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文