开发者

Specify rowterminator when creating a file with SQLCMD

开发者 https://www.devze.com 2022-12-27 06:56 出处:网络
How do you specify the the row terminator when outputting query results using sqlc开发者_运维问答md?

How do you specify the the row terminator when outputting query results using sqlc开发者_运维问答md?

bcp is not an option.

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. 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...

0

精彩评论

暂无评论...
验证码 换一张
取 消