简体   繁体   English

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

[英]Specify rowterminator when creating a file with SQLCMD

How do you specify the the row terminator when outputting query results using sqlcmd? 使用sqlcmd输出查询结果时如何指定行终止符?

bcp is not an option. bcp不是一个选项。

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

What is the default row terminator? 默认的行终止符是什么?

You can only choose column separator with -s. 您只能使用-s选择列分隔符。 There is not option to specify row terminator. 没有选项来指定行终止符。

So it is CR + LF because the output goes to command line. 因为输出转到命令行,所以它是CR + LF。 However, data may be truncated so you have to control the output width. 但是,数据可能会被截断,因此您必须控制输出宽度。

See sqlcmd for -s, -w, -W, -y, -Y etc 有关-s,-w,-W,-y,-Y等,请参见sqlcmd

bcp may not be an option, as you say, but neither is row terminator in sqlcmd... 正如您所说,bcp可能不是一个选项,但是sqlcmd中的行终止符都不是...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM